8000 [DI] Fix fatal error at ContainerBuilder::compile() if config is not installed by chalasr · Pull Request #22240 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI] Fix fatal error at ContainerBuilder::compile() if config is not installed #22240

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

Merged
merged 1 commit into from
Apr 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Symfony/Component/DependencyInjection/ContainerBuilder.php
8000
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Symfony\Component\Config\Resource\ResourceInterface;
use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface;
use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;

Expand Down Expand Up @@ -73,7 +74,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*/
private $compiler;

private $trackResources = true;
private $trackResources;

/**
* @var InstantiatorInterface|null
Expand All @@ -90,6 +91,13 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*/
private $expressionLanguageProviders = array();

public function __construct(ParameterBagInterface $parameterBag = null)
{
parent::__construct($parameterBag);

$this->trackResources = interface_exists('Symfony\Component\Config\Resource\ResourceInterface');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be simply interface_exists(ResourceInterface::class);? The class is already imported anyway

Copy link
Member Author

Choose a reason for hiding this comment

< 63E4 p class="mb-3"> The reason will be displayed to describe this comment to others. Learn more.

This targets 2.7 which supports PHP 5.3+ :/

}

/**
* Sets the track resources flag.
*
Expand Down
0