Example #1
0
 public function store(Item $item)
 {
     $this->delete($item->getKey());
     return file_put_contents($this->generateNewFilename($item), serialize($item)) !== false;
 }
Example #2
0
 public function testIsExpired()
 {
     $item = new Item('key');
     $item->expiresAfter(10);
     $this->assertFalse($item->isExpired());
     $item->expiresAfter(-10);
     $this->assertTrue($item->isExpired());
 }
Example #3
0
 public function store(Item $item)
 {
     $this->data[$item->getKey()] = $item;
     return true;
 }