Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request ezsystems#1153 from glye/ezp-24197_ezcache_expire_…
…only_with_purge

Fix EZP-24197: DOC: ezcache.php --expiry parameter can only be used together with --purge
  • Loading branch information
glye committed Mar 27, 2015
2 parents 3882dd3 + d471df7 commit 8b1dfe1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/php/ezcache.php
Expand Up @@ -36,7 +36,7 @@
'purge' => 'Enforces purging of cache items which ensures that specified entries are physically removed (Useful for saving diskspace). Used together with the clear-* options.',
'iteration-sleep' => 'Amount of seconds to sleep between each iteration when performing a purge operation, can be a float.',
'iteration-max' => 'Amount of items to remove in each iteration when performing a purge operation.',
'expiry' => 'Date or relative time which specifies when cache items are to be considered expired, e.g \'now\', \'-2 days\' or \'last monday\'',
'expiry' => 'Date or relative time which specifies when cache items are to be considered expired, e.g \'now\', \'-2 days\' or \'last monday\'. Can only be used together with --purge.',
'list-tags' => 'Lists all available tags',
'list-ids' => 'Lists all available ids' ) );

Expand All @@ -55,6 +55,11 @@
$purgeExpiry = false;
if ( $options['expiry'] )
{
if ( !$options['purge'] )
{
$cli->error( "--expiry can only be used together with --purge" );
$script->shutdown( 1 );
}
$expiryText = trim( $options['expiry'] );
$purgeExpiry = strtotime( $expiryText );
if ( $purgeExpiry == -1 || $purgeExpiry === false )
Expand Down

0 comments on commit 8b1dfe1

Please sign in to comment.