From 6a03d7f91735e4b073d3dc585254c557afeb05f6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 28 Jun 2024 11:10:31 +0200 Subject: [PATCH 1/2] [Filesystem] Fix Filesystem::remove() on Windows --- Filesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Filesystem.php b/Filesystem.php index 700311d58..958ef178d 100644 --- a/Filesystem.php +++ b/Filesystem.php @@ -173,7 +173,7 @@ private static function doRemove(array $files, bool $isRecursive): void } } elseif (is_dir($file)) { if (!$isRecursive) { - $tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-_')); + $tmpName = \dirname(realpath($file)).'/.!'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-!')); if (file_exists($tmpName)) { try { From 6d29dd9340b372fa603f04e6df4dd76bb808591e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 28 Jun 2024 11:36:24 +0200 Subject: [PATCH 2/2] [Filesystem][Mime] Fix transient tests --- Tests/FilesystemTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/FilesystemTest.php b/Tests/FilesystemTest.php index 101f30f89..eea5fe1a6 100644 --- a/Tests/FilesystemTest.php +++ b/Tests/FilesystemTest.php @@ -171,17 +171,17 @@ public function testCopyForOriginUrlsAndExistingLocalFileDefaultsToCopy() } $finder = new PhpExecutableFinder(); - $process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', 'localhost:8057'])); + $process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', 'localhost:8857'])); $process->setWorkingDirectory(__DIR__.'/Fixtures/web'); $process->start(); do { usleep(50000); - } while (!@fopen('http://localhost:8057', 'r')); + } while (!@fopen('http://localhost:8857', 'r')); try { - $sourceFilePath = 'http://localhost:8057/logo_symfony_header.png'; + $sourceFilePath = 'http://localhost:8857/logo_symfony_header.png'; $targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file'; file_put_contents($targetFilePath, 'TARGET FILE'); $this->filesystem->copy($sourceFilePath, $targetFilePath, false);