save() public méthode

public save ( string $keyName = null, string $content = null, integer $lifetime = null, boolean $stopBuffer = true ) : boolean
$keyName string
$content string
$lifetime integer
$stopBuffer boolean
Résultat boolean
Exemple #1
0
 protected function runTests(CacheBackend $backend, $lifetime = null)
 {
     $backend->save($this->key, $this->data, $lifetime);
     $this->assertTrue($backend->exists($this->key));
     $this->assertEquals($this->data, $backend->get($this->key));
     $this->assertNotEmpty($backend->queryKeys());
     $this->assertNotEmpty($backend->queryKeys('DB_'));
     $this->assertTrue($backend->delete($this->key));
     $this->assertFalse($backend->delete($this->key));
     if (null !== $lifetime) {
         $backend->save($this->key, $this->data, $lifetime);
         $this->assertTrue($backend->exists($this->key, $lifetime));
         $this->assertEquals($this->data, $backend->get($this->key, $lifetime));
         $backend->save($this->key, $this->data, -$lifetime);
         $this->assertFalse($backend->exists($this->key, -$lifetime));
     }
 }