kernel/private/classes/ezscripttrashpurge.php
This class handles purging of trash items. It is used by both the script and cronjob.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- kernel
- Version
- 4.6.0
\eZScriptTrashPurge
Package: kernel
This class handles purging of trash items. It is used by both the script and cronjob.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Version
- 4.6.0
Properties
Methods


__construct(
\eZCLI $cli, bool $quiet
=
true, bool $memoryMonitoring
=
false, \eZScript $script
=
null, string $logFile
=
"trashpurge.log"
)
:
void
Constructor of eZScriptTrashPurge.
Parameters
Name | Type | Description |
---|---|---|
$cli | \eZCLI | The instance of eZCLI. |
$quiet | bool | Whether the operation should be quiet or not. |
$memoryMonitoring | bool | Set to true to turn on memory monitoring. |
$script | \eZScript | Optional eZScript object used while running. |
$logFile | string | Log file to use for memory monitoring. |


monitor(
string $text
)
:
void
Log memory usage.
Parameters
Name | Type | Description |
---|---|---|
$text | string | Text to use while logging. |


run(
int | null $iterationLimit
=
100, int | null $sleep
=
1
)
:
bool
Executes the purge operation
Parameters
Returns
Name | Type | Description |
---|---|---|
$iterationLimit | int | null | Number of trashed objects to treat per iteration, use null to use a default value. |
$sleep | int | null | Number of seconds to sleep between two iterations, use null to use a default value. |
Type | Description |
---|---|
bool | True if the operation succeeded. |