Skip to content

Commit c4015ed

Browse files
committed
bug #38343 Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable" (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable" | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #38334 | License | MIT | Doc PR | - As discussed in the linked issue, let's replace this with a recipe: symfony/recipes#825 TL;DR, these PRs replace `src/.preload.php` (generated) by `config/preload.php` (committed). Commits ------- 662fcff Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)"
2 parents 72ff401 + 662fcff commit c4015ed

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
170170
}
171171
}
172172

173-
$kernelDir = \dirname((new \ReflectionObject($kernel))->getFileName());
174-
$preloadFile = $fs->makePathRelative(\dirname($containerFile, 2), $kernelDir);
175-
$preloadFile .= substr_replace(basename($containerFile), '.preload', -4, 0);
176-
$preloadFile = var_export('/'.$preloadFile, true);
177-
@file_put_contents($kernelDir.'/.preload.php', <<<EOPHP
178-
<?php
179-
180-
if (file_exists(__DIR__.$preloadFile)) {
181-
require __DIR__.$preloadFile;
182-
}
183-
184-
EOPHP
185-
);
186-
187173
if ($output->isVerbose()) {
188174
$io->comment('Finished');
189175
}

src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ protected function setUp(): void
3838
protected function tearDown(): void
3939
{
4040
$this->fs->remove($this->kernel->getProjectDir());
41-
$this->fs->remove(__DIR__.'/Fixture/.preload.php');
4241
}
4342

4443
public function testCacheIsFreshAfterCacheClearedWithWarmup()
@@ -83,7 +82,5 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup()
8382
$containerRef = new \ReflectionClass(require $containerFile);
8483
$containerFile = str_replace('tes_'.\DIRECTORY_SEPARATOR, 'test'.\DIRECTORY_SEPARATOR, $containerRef->getFileName());
8584
$this->assertMatchesRegularExpression(sprintf('/\'kernel.container_class\'\s*=>\s*\'%s\'/', $containerClass), file_get_contents($containerFile), 'kernel.container_class is properly set on the dumped container');
86-
87-
$this->assertFileEquals(__DIR__.'/Fixture/preload.php.expected', __DIR__.'/Fixture/.preload.php');
8885
}
8986
}

src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/preload.php.expected

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)