Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
deleteCacheDirectories example
public
function
cleanup
(
$useTimer
= true
)
{
$this
->useTimer =
$useTimer
;
if
(
$this
->useTimer
)
{
$this
->timeTarget =
time
(
)
+ 5;
}
try
{
$result
=
$this
->
deleteCacheDirectories
(
0
)
;
if
(
!
$result
->
getIsReady
(
)
&&
$this
->useTimer
)
{
return
json_encode
(
[
'deletedFiles' =>
$result
->
getFileCount
(
)
,
'ready' =>
$result
->
getIsReady
(
)
,
'error' => false,
]
)
;
}
$result
=
$this
->
deleteTemporaryBackupDirectory
(
$result
->
getFileCount
(
)
)
;
if
(
$this
->useTimer
)
{
return
json_encode
(
[