From 662fcff40f131e8303d5bf0ddd3e327f19e9734a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 29 Sep 2020 11:51:46 +0200 Subject: [PATCH] Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)" This reverts commit d441d867cd1da214b1c9662568b11632e8e57f52, reversing changes made to 043e7c34de230179a993cfb8afb964dee9eef8de. --- .../FrameworkBundle/Command/CacheClearCommand.php | 14 -------------- .../CacheClearCommand/CacheClearCommandTest.php | 3 --- .../CacheClearCommand/Fixture/preload.php.expected | 5 ----- 3 files changed, 22 deletions(-) delete mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/preload.php.expected diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index 916dd3b976..75836ce0b7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -170,20 +170,6 @@ EOF } } - $kernelDir = \dirname((new \ReflectionObject($kernel))->getFileName()); - $preloadFile = $fs->makePathRelative(\dirname($containerFile, 2), $kernelDir); - $preloadFile .= substr_replace(basename($containerFile), '.preload', -4, 0); - $preloadFile = var_export('/'.$preloadFile, true); - @file_put_contents($kernelDir.'/.preload.php', <<isVerbose()) { $io->comment('Finished'); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php index 41769f49d1..4b557011a9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php @@ -38,7 +38,6 @@ class CacheClearCommandTest extends TestCase protected function tearDown(): void { $this->fs->remove($this->kernel->getProjectDir()); - $this->fs->remove(__DIR__.'/Fixture/.preload.php'); } public function testCacheIsFreshAfterCacheClearedWithWarmup() @@ -83,7 +82,5 @@ class CacheClearCommandTest extends TestCase $containerRef = new \ReflectionClass(require $containerFile); $containerFile = str_replace('tes_'.\DIRECTORY_SEPARATOR, 'test'.\DIRECTORY_SEPARATOR, $containerRef->getFileName()); $this->assertMatchesRegularExpression(sprintf('/\'kernel.container_class\'\s*=>\s*\'%s\'/', $containerClass), file_get_contents($containerFile), 'kernel.container_class is properly set on the dumped container'); - - $this->assertFileEquals(__DIR__.'/Fixture/preload.php.expected', __DIR__.'/Fixture/.preload.php'); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/preload.php.expected b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/preload.php.expected deleted file mode 100644 index 4b9461981b..0000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/preload.php.expected +++ /dev/null @@ -1,5 +0,0 @@ -