Ejemplo n.º 1
0
 /**
  * Destructor.
  *
  * @access  public
  */
 public function __destruct()
 {
     if ($this->cache !== null && $this->rebuildCache) {
         foreach ($this->strings as $language => $strings) {
             $this->cache->put('mako.i18n.' . $language, $strings, 3600);
         }
     }
 }
Ejemplo n.º 2
0
 /**
  *
  */
 public function testPut()
 {
     $store = $this->getStore();
     $store->shouldReceive('put')->once()->with('foo', 'bar', 0)->andReturn(true);
     $cache = new Cache($store);
     $cache->put('foo', 'bar');
     //
     $store = $this->getStore();
     $store->shouldReceive('put')->once()->with('foo', 'bar', 3600)->andReturn(true);
     $cache = new Cache($store);
     $cache->put('foo', 'bar', 3600);
     //
     $store = $this->getStore();
     $store->shouldReceive('put')->once()->with('baz.foo', 'bar', 3600)->andReturn(true);
     $cache = new Cache($store, 'baz');
     $cache->put('foo', 'bar', 3600);
 }