Skip to content

Commit

Permalink
Merge branch '4.4' into 5.1
Browse files Browse the repository at this point in the history
* 4.4:
  Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)"
  [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
  • Loading branch information
fabpot committed Sep 30, 2020
2 parents 7910c19 + 01c517f commit 023ca65
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
14 changes: 0 additions & 14 deletions Command/CacheClearCommand.php
Expand Up @@ -175,20 +175,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
}

$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', <<<EOPHP
<?php
if (file_exists(__DIR__.$preloadFile)) {
require __DIR__.$preloadFile;
}
EOPHP
);

if ($output->isVerbose()) {
$io->comment('Finished');
}
Expand Down
3 changes: 0 additions & 3 deletions Tests/Command/CacheClearCommand/CacheClearCommandTest.php
Expand Up @@ -38,7 +38,6 @@ protected function setUp(): void
protected function tearDown(): void
{
$this->fs->remove($this->kernel->getProjectDir());
$this->fs->remove(__DIR__.'/Fixture/.preload.php');
}

public function testCacheIsFreshAfterCacheClearedWithWarmup()
Expand Down Expand Up @@ -83,7 +82,5 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup()
$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');
}
}
5 changes: 0 additions & 5 deletions Tests/Command/CacheClearCommand/Fixture/preload.php.expected

This file was deleted.

0 comments on commit 023ca65

Please sign in to comment.