Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit19fd27d

Browse files
[FrameworkBundle] Fix patching refs to the tmp warmup dir in files generated by optional cache warmers
1 parent02db9c2 commit19fd27d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
146146
}
147147
$this->warmupOptionals($useBuildDir ?$realCacheDir :$warmupDir,$warmupDir,$io);
148148
}
149+
150+
// fix references to cached files with the real cache directory name
151+
$search = [$warmupDir,str_replace('/','\\/',$warmupDir),str_replace('\\','\\\\',$warmupDir)];
152+
$replace =str_replace('\\','/',$realBuildDir);
153+
foreach (Finder::create()->files()->in($warmupDir)as$file) {
154+
$content =str_replace($search,$replace,file_get_contents($file),$count);
155+
if ($count) {
156+
file_put_contents($file,$content);
157+
}
158+
}
149159
}
150160

151161
if (!$fs->exists($warmupDir.'/'.$containerDir)) {
@@ -227,16 +237,6 @@ private function warmup(string $warmupDir, string $realBuildDir): void
227237
thrownew \LogicException('Calling "cache:clear" with a kernel that does not implement "Symfony\Component\HttpKernel\RebootableInterface" is not supported.');
228238
}
229239
$kernel->reboot($warmupDir);
230-
231-
// fix references to cached files with the real cache directory name
232-
$search = [$warmupDir,str_replace('\\','\\\\',$warmupDir)];
233-
$replace =str_replace('\\','/',$realBuildDir);
234-
foreach (Finder::create()->files()->in($warmupDir)as$file) {
235-
$content =str_replace($search,$replace,file_get_contents($file),$count);
236-
if ($count) {
237-
file_put_contents($file,$content);
238-
}
239-
}
240240
}
241241

242242
privatefunctionwarmupOptionals(string$cacheDir,string$warmupDir,SymfonyStyle$io):void

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp