Returns a timestamp for when the cache was created.
string $resource A cache key:
integer A UNIX timestamp
public function getTimestamp($resource) {
$path = $this
->getSourcePath($resource);
if (!file_exists($path)) {
throw new \RuntimeException('There is no cached value for ' . $resource);
}
if (false === ($mtime = @filemtime($path))) {
// @codeCoverageIgnoreStart
throw new \RuntimeException('Unable to determine file mtime for ' . $path);
// @codeCoverageIgnoreEnd
}
return $mtime;
}