public function ConfigCache::getTimestamp

Returns a timestamp for when the cache was created.

Parameters

string $resource A cache key:

Return value

integer A UNIX timestamp

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php, line 93

Class

ConfigCache
A config cache stores values using var_export() and include.

Namespace

Assetic\Cache

Code

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;
}