bug #37353 [DI] disable preload.php on the CLI (nicolas-grekas)
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] disable preload.php on the CLI
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #37152
| License | MIT
| Doc PR | -
See linked issue for a nasty side-effect of preloading on the CLI. Many hosting solutions do not provide a way to set different ini settings for CLI vs FPM. Let's skip preloading anything on the CLI.
Commits
-------
50ccf2f1b2
[DI] disable preload.php on the CLI
This commit is contained in:
commit
b690a4a352
@ -319,6 +319,10 @@ EOF;
|
|||||||
|
|
||||||
use Symfony\Component\DependencyInjection\Dumper\Preloader;
|
use Symfony\Component\DependencyInjection\Dumper\Preloader;
|
||||||
|
|
||||||
|
if (in_array(PHP_SAPI, ['cli', 'phpdbg'], true)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
require $autoloadFile;
|
require $autoloadFile;
|
||||||
require __DIR__.'/Container{$hash}/{$options['class']}.php';
|
require __DIR__.'/Container{$hash}/{$options['class']}.php';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user