Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
MergeExtensionConfigurationContainerBuilder example
$resolvingBag
=
$container
->
getParameterBag
(
)
;
if
(
$resolvingBag
instanceof EnvPlaceholderParameterBag &&
$extension
instanceof Extension
)
{
// create a dedicated bag so that we can track env vars per-extension
$resolvingBag
=
new
MergeExtensionConfigurationParameterBag
(
$resolvingBag
)
;
if
(
$configAvailable
)
{
BaseNode::
setPlaceholderUniquePrefix
(
$resolvingBag
->
getEnvPlaceholderUniquePrefix
(
)
)
;
}
}
$config
=
$resolvingBag
->
resolveValue
(
$config
)
;
try
{
$tmpContainer
=
new
MergeExtensionConfigurationContainerBuilder
(
$extension
,
$resolvingBag
)
;
$tmpContainer
->
setResourceTracking
(
$container
->
isTrackingResources
(
)
)
;
$tmpContainer
->
addObjectResource
(
$extension
)
;
if
(
$extension
instanceof ConfigurationExtensionInterface && null !==
$configuration
=
$extension
->
getConfiguration
(
$config
,
$tmpContainer
)
)
{
$tmpContainer
->
addObjectResource
(
$configuration
)
;
}
foreach
(
$exprLangProviders
as
$provider
)
{
$tmpContainer
->
addExpressionLanguageProvider
(
$provider
)
;
}
$extension
->
load
(
$config
,
$tmpContainer
)
;
}
$resolvingBag
=
$container
->
getParameterBag
(
)
;
if
(
$resolvingBag
instanceof EnvPlaceholderParameterBag &&
$extension
instanceof Extension
)
{
// create a dedicated bag so that we can track env vars per-extension
$resolvingBag
=
new
MergeExtensionConfigurationParameterBag
(
$resolvingBag
)
;
if
(
$configAvailable
)
{
BaseNode::
setPlaceholderUniquePrefix
(
$resolvingBag
->
getEnvPlaceholderUniquePrefix
(
)
)
;
}
}
$config
=
$resolvingBag
->
resolveValue
(
$config
)
;
try
{
$tmpContainer
=
new
MergeExtensionConfigurationContainerBuilder
(
$extension
,
$resolvingBag
)
;
$tmpContainer
->
setResourceTracking
(
$container
->
isTrackingResources
(
)
)
;
$tmpContainer
->
addObjectResource
(
$extension
)
;
if
(
$extension
instanceof ConfigurationExtensionInterface && null !==
$configuration
=
$extension
->
getConfiguration
(
$config
,
$tmpContainer
)
)
{
$tmpContainer
->
addObjectResource
(
$configuration
)
;
}
foreach
(
$exprLangProviders
as
$provider
)
{
$tmpContainer
->
addExpressionLanguageProvider
(
$provider
)
;
}
$extension
->
load
(
$config
,
$tmpContainer
)
;
}