Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
checkIsBot example
if
(
PHP_SAPI === 'cli'
)
{
return
;
}
$container
=
Shopware
(
)
->
Container
(
)
;
if
(
!
$container
->
initialized
(
'session'
)
)
{
return
;
}
/** @var Shopware_Plugins_Frontend_Statistics_Bootstrap $plugin */
$plugin
=
Shopware
(
)
->
Plugins
(
)
->
Frontend
(
)
->
Statistics
(
)
;
if
(
$plugin
->
checkIsBot
(
$args
->
getRequest
(
)
->
getHeader
(
'USER_AGENT'
)
?: ''
)
)
{
$this
->
get
(
'session'
)
->
invalidate
(
)
;
}
}
/** * Event listener method * * @return \sSystem */
public
function
onInitResourceSystem
(
Enlight_Event_EventArgs
$args
)
{