public function HttpAsset::getLastModified

Returns the time the current asset was last modified.

Return value

integer|null A UNIX timestamp

Overrides AssetInterface::getLastModified

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php, line 67

Class

HttpAsset
Represents an asset loaded via an HTTP request.

Namespace

Assetic\Asset

Code

public function getLastModified() {
  if (false !== @file_get_contents($this->sourceUrl, false, stream_context_create(array(
    'http' => array(
      'method' => 'HEAD',
    ),
  )))) {
    foreach ($http_response_header as $header) {
      if (0 === stripos($header, 'Last-Modified: ')) {
        list(, $mtime) = explode(':', $header, 2);
        return strtotime(trim($mtime));
      }
    }
  }
}