Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getContainerLoader example
if
(
false === @
mkdir
(
$dir
, 0777, true
)
&& !
is_dir
(
$dir
)
)
{
throw
new
\
RuntimeException
(
sprintf
(
'Unable to create the "%s" directory (%s).',
$name
,
$dir
)
)
;
}
}
elseif
(
!
is_writable
(
$dir
)
)
{
throw
new
\
RuntimeException
(
sprintf
(
'Unable to write in the "%s" directory (%s).',
$name
,
$dir
)
)
;
}
}
$container
=
$this
->
getContainerBuilder
(
)
;
$container
->
addObjectResource
(
$this
)
;
$this
->
prepareContainer
(
$container
)
;
$this
->
registerContainerConfiguration
(
$this
->
getContainerLoader
(
$container
)
)
;
$container
->
addCompilerPass
(
new
AddAnnotatedClassesToCachePass
(
$this
)
)
;
return
$container
;
}
/** * Prepares the ContainerBuilder before it is compiled. * * @return void */
if
(
false === @
mkdir
(
$dir
, 0777, true
)
&& !
is_dir
(
$dir
)
)
{
throw
new
\
RuntimeException
(
sprintf
(
'Unable to create the "%s" directory (%s).',
$name
,
$dir
)
)
;
}
}
elseif
(
!
is_writable
(
$dir
)
)
{
throw
new
\
RuntimeException
(
sprintf
(
'Unable to write in the "%s" directory (%s).',
$name
,
$dir
)
)
;
}
}
$container
=
$this
->
getContainerBuilder
(
)
;
$container
->
addObjectResource
(
$this
)
;
$this
->
prepareContainer
(
$container
)
;
$this
->
registerContainerConfiguration
(
$this
->
getContainerLoader
(
$container
)
)
;
$container
->
addCompilerPass
(
new
AddAnnotatedClassesToCachePass
(
$this
)
)
;
return
$container
;
}
/** * Prepares the ContainerBuilder before it is compiled. * * @return void */
throw
new
RuntimeException
(
sprintf
(
"Unable to create the %s directory (%s)\n",
$name
,
$dir
)
)
;
}
}
elseif
(
!
is_writable
(
$dir
)
)
{
throw
new
RuntimeException
(
sprintf
(
"Unable to write in the %s directory (%s)\n",
$name
,
$dir
)
)
;
}
}
$container
=
$this
->
getContainerBuilder
(
)
;
$container
->
addObjectResource
(
$this
)
;
$this
->
prepareContainer
(
$container
)
;
if
(
null !==
$cont
=
$this
->
registerContainerConfiguration
(
$this
->
getContainerLoader
(
$container
)
)
)
{
$container
->
merge
(
$cont
)
;
}
return
$container
;
}
/** * Prepares the ContainerBuilder before it is compiled. * * @param ContainerBuilder $container A ContainerBuilder instance * * @throws Exception */