Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addResources example
$loader
=
new
XmlFileLoader
(
$container
,
new
FileLocator
(
__DIR__ . '/Components/DependencyInjection/'
)
)
;
$loader
->
load
(
'services.xml'
)
;
$loader
->
load
(
'theme.xml'
)
;
$loader
->
load
(
'logger.xml'
)
;
$loader
->
load
(
'commands.xml'
)
;
if
(
is_file
(
$file
= __DIR__ . '/Components/DependencyInjection/services_local.xml'
)
)
{
$loader
->
load
(
$file
)
;
}
$this
->
addShopwareConfig
(
$container
, 'shopware',
$this
->config
)
;
$this
->
addResources
(
$container
)
;
$container
->
addCompilerPass
(
new
EventListenerCompilerPass
(
)
, PassConfig::TYPE_BEFORE_REMOVING
)
;
$container
->
addCompilerPass
(
new
EventSubscriberCompilerPass
(
)
, PassConfig::TYPE_BEFORE_REMOVING
)
;
$container
->
addCompilerPass
(
new
DoctrineEventSubscriberCompilerPass
(
)
)
;
$container
->
addCompilerPass
(
new
FormPass
(
)
)
;
$container
->
addCompilerPass
(
new
AddConstraintValidatorsPass
(
)
)
;
$container
->
addCompilerPass
(
new
StaticResourcesCompilerPass
(
)
)
;
$container
->
addCompilerPass
(
new
AddConsoleCommandPass
(
)
)
;
$container
->
addCompilerPass
(
new
ConfigureContainerAwareCommands
(
)
)
;
$container
->
addCompilerPass
(
new
LegacyApiResourcesPass
(
)
)
;
$container
->
addCompilerPass
(
new
ConfigureApiResourcesPass
(
)
, PassConfig::TYPE_OPTIMIZE, -500
)
;