Skip to content

Commit

Permalink
added clearAll() method
Browse files Browse the repository at this point in the history
  • Loading branch information
mirko-pagliai committed Mar 25, 2016
1 parent 9290327 commit a8c2d05
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Cache/Cache.php
Expand Up @@ -445,6 +445,25 @@ public static function clear($check = false, $config = 'default')
$engine = static::engine($config);
return $engine->clear($check);
}

/**
* Delete all keys from the cache from all configurations.
*
* @param bool $check if true will check expiration, otherwise delete all
* @return bool True if the cache of all configurations was successfully cleared, false otherwise
*/
public static function clearAll($check = false)
{
$success = true;

foreach (self::configured() as $config) {
if (!self::clear($check, $config)) {
$success = false;
}
}

return $success;
}

/**
* Delete all keys from the cache belonging to the same group.
Expand Down

0 comments on commit a8c2d05

Please sign in to comment.