-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Fix hardcoded cache dir for warmups #26662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ad9d359
to
998b210
Compare
@@ -963,7 +963,7 @@ public function __construct() | |||
|
|||
EOF; | |||
if (null !== $this->targetDirRegex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in which case can this regex be null ? The $this->containerDir
variable will not be assigned at all currently in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, looking at it, it might happens in some cases. So I suggest you to move the $this->containerDir = $dir
assignment to a dedicated statement added in the compiled code outside this if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, wrong "if", fixed thanks
@@ -963,7 +963,7 @@ public function __construct() | |||
|
|||
EOF; | |||
if (null !== $this->targetDirRegex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, looking at it, it might happens in some cases. So I suggest you to move the $this->containerDir = $dir
assignment to a dedicated statement added in the compiled code outside this if
$code = str_replace('$parameters', "\$buildParameters;\n private \$parameters", $code); | ||
$code = str_replace('__construct()', '__construct(array $buildParameters = array())', $code); | ||
$code = str_replace('$parameters', "\$buildParameters;\n private \$containerDir;\n private \$parameters", $code); | ||
$code = str_replace('__construct()', '__construct(array $buildParameters = array(), $dir = __DIR__)', $code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default value of the argument is broken. The compiled code expects the containerDir
to end with a directory separator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ee78940
to
879d71f
Compare
879d71f
to
599dbca
Compare
Thank you @nicolas-grekas. |
This PR was merged into the 3.4 branch. Discussion ---------- [DI] Fix hardcoded cache dir for warmups | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26506, #26219 | License | MIT | Doc PR | - Commits ------- 599dbca [DI] Fix hardcoded cache dir for warmups
Uh oh!
There was an error while loading. Please reload this page.