bug #33539 [DI] fix related to preloading (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix related to preloading

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

e25c5957e0 [DI] fix related to preloading
This commit is contained in:
Nicolas Grekas 2019-09-10 17:58:35 +02:00
commit c403706167
2 changed files with 5 additions and 1 deletions

View File

@ -2047,7 +2047,7 @@ EOF;
foreach (get_declared_classes() as $class) {
if (0 === strpos($class, 'ComposerAutoloaderInit') && $class::getLoader() === $autoloader[0]) {
$file = (new \ReflectionClass($class))->getFileName();
$file = \dirname((new \ReflectionClass($class))->getFileName(), 2).'/autoload.php';
if (preg_match($this->targetDirRegex.'A', $file)) {
return $file;

View File

@ -14,6 +14,10 @@ namespace Symfony\Component\DependencyInjection;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
if (!class_exists(BaseExpressionLanguage::class)) {
throw new \ReflectionException(BaseExpressionLanguage::class.' not found.');
}
/**
* Adds some function to the default ExpressionLanguage.
*