Skip to content

Commit

Permalink
Fix scope of Symfony container cache in production Phar
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Feb 16, 2024
1 parent 16711d8 commit 5cb1151
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,14 @@ static function (string $filePath, string $prefix, string $contents): string {
{', "private function fileExcerpt(string \$file, int \$line, int \$srcContext = 3) : string
{ return '';", $contents);
},

// Fix prod container cache path
static function (string $filePath, string $prefix, string $contents): string {
if (!str_starts_with($filePath, 'vendor/symfony/http-kernel/Kernel.php')) {
return $contents;
}

return str_replace("\$buildDir . '/' . \$class . '.php'", "\$buildDir.'/'.str_replace('".$prefix."_', '', \$class).'.php'", $contents);
},
],
];

0 comments on commit 5cb1151

Please sign in to comment.