clear() public method

Clears all cached values under the namespace.
public clear ( ) : void
return void
Beispiel #1
0
 /**
  * @return ICacheAdapter
  */
 private static function getImplementation()
 {
     if (self::$cacheImplementation === null) {
         self::$cacheImplementation = new NullCache();
     }
     if (self::$isDevelopmentMode && !self::$hasBeenCleared) {
         self::$cacheImplementation->clear();
         self::$hasBeenCleared = true;
     }
     return self::$cacheImplementation;
 }
Beispiel #2
0
 public function testThatNamespaceWillNotClearInAnotherNamespaces()
 {
     $anotherNamespaceCache = $this->namespacedCache->forNamespace('another::namespace');
     $anotherNamespaceCache->save('in-another-namespace-1', 1);
     $anotherNamespaceCache->save('in-another-namespace-2', 2);
     $this->namespacedCache->save('in-namespace', 2);
     $this->namespacedCache->clear();
     $this->assertFalse($this->namespacedCache->contains('in-namespace'));
     $this->assertTrue($anotherNamespaceCache->contains('in-another-namespace-1'));
     $this->assertTrue($anotherNamespaceCache->contains('in-another-namespace-2'));
 }
Beispiel #3
0
 public function clear()
 {
     self::$secondLevelCache = [];
     $this->cacheAdapter->clear();
 }