예제 #1
0
파일: Cache.php 프로젝트: NiR-/Gaufrette
 /**
  * Indicates whether the serialized cache file needs to be rebuild.
  *
  * @param string $cacheFile
  */
 public function needsRebuild($cacheFile)
 {
     $needsRebuild = true;
     if ($this->serializeCache->exists($cacheFile)) {
         try {
             $needsRebuild = time() - $this->ttl >= $this->serializeCache->mtime($cacheFile);
         } catch (\RuntimeException $e) {
         }
     }
     return $needsRebuild;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function mtime($key)
 {
     return $this->master->mtime($key);
 }
 /**
  * @param \Gaufrette\Adapter $adapter
  */
 function it_gets_mtime_of_file_using_adapter($adapter)
 {
     $adapter->exists('filename')->willReturn(true);
     $adapter->mtime('filename')->willReturn(1234567);
     $this->mtime('filename')->shouldReturn(1234567);
 }
 /**
  * @param \Gaufrette\Adapter $adapter
  */
 function it_delegates_mtime($adapter)
 {
     $adapter->mtime('filename')->willReturn(1234);
     $adapter->mtime('filename2')->willReturn(2345);
     $this->mtime('filename')->shouldReturn(1234);
     $this->mtime('filename2')->shouldReturn(2345);
 }
예제 #5
0
 /**
  * @param \Gaufrette\Adapter $source
  */
 function it_should_get_mtime_from_source($source)
 {
     $source->mtime('filename')->shouldBeCalled()->willReturn(1234);
     $this->mtime('filename')->shouldReturn(1234);
 }
 /**
  * {@inheritDoc}
  */
 public function mtime($key)
 {
     return $this->primary->mtime($key);
 }