Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
compileLess example
return
;
}
if
(
$shop
->
getMain
(
)
)
{
$shop
=
$shop
->
getMain
(
)
;
}
try
{
/** @var Compiler $compiler */
$compiler
=
$this
->container->
get
(
'theme_compiler'
)
;
$compiler
->
compileJavascript
(
'new',
$shop
->
getTemplate
(
)
,
$shop
)
;
$compiler
->
compileLess
(
'new',
$shop
->
getTemplate
(
)
,
$shop
)
;
}
catch
(
Exception
$e
)
{
$this
->
View
(
)
->
assign
(
[
'success' => false, 'message' =>
$e
->
getMessage
(
)
]
)
;
return
;
}
$this
->
View
(
)
->
assign
(
[
'success' => true,
]
)
;
}
$url
=
$pathResolver
->
formatPathToUrl
(
$file
,
$shop
)
;
if
(
!
$settings
->
getForceCompile
(
)
&&
file_exists
(
$file
)
)
{
// see: http://stackoverflow.com/a/9473886
$template
->
assign
(
$output
,
[
$url
]
)
;
return
;
}
/** @var \Shopware\Components\Theme\Compiler $compiler */
$compiler
=
Shopware
(
)
->
Container
(
)
->
get
(
'theme_compiler'
)
;
$compiler
->
compileLess
(
$time
,
$shop
->
getTemplate
(
)
,
$shop
)
;
$template
->
assign
(
$output
,
[
$url
]
)
;
}
public
function
compile
(
Shop
$shop
)
{
if
(
$shop
->
getMain
(
)
)
{
$shop
=
$shop
->
getMain
(
)
;
}
$old
=
$this
->
getThemeTimestamp
(
$shop
)
;
$timestamp
=
time
(
)
;
$this
->
compileLess
(
$timestamp
,
$shop
->
getTemplate
(
)
,
$shop
)
;
$this
->
compileJavascript
(
$timestamp
,
$shop
->
getTemplate
(
)
,
$shop
)
;
$this
->
createThemeTimestamp
(
$shop
,
$timestamp
)
;
$this
->
clearThemeCache
(
$shop
,
$old
)
;
}
/** * @return void */
public
function
recompile
(
Shop
$shop
)
{