lithium\storage\Cache::clean PHP Метод

clean() публичный статический Метод

Perform garbage collection on specified cache configuration. All invalidated cache keys - *without* honoring a configured scope - from the specified configuration are removed.
public static clean ( string $name ) : boolean
$name string The cache configuration to be cleaned.
Результат boolean `true` on successful cleaning, `false` if failed partially or entirely.
    public static function clean($name)
    {
        try {
            return static::adapter($name)->clean();
        } catch (ConfigException $e) {
            return false;
        }
    }

Usage Example

Пример #1
0
 public function testClean()
 {
     $config = array('default' => array('adapter' => 'Memory', 'filters' => array()));
     Cache::config($config);
     $result = Cache::config();
     $expected = $config;
     $this->assertEqual($expected, $result);
     $result = Cache::clean('non_existing');
     $this->assertFalse($result);
     $result = Cache::clean('default');
     $this->assertFalse($result);
 }