/** * 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; }
/** * {@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); }
/** * @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); }