function assignLastModified()
 {
     $lastModified = new Mock_binarypool_lastmodified();
     binarypool_views::$lastModified = $lastModified;
 }
Exemple #2
0
 /**
  * Create the URL view symlink for files which were downloaded 
  *
  * @param $asset: An object of binarypool_asset.
  */
 private static function linkURL($bucket, $asset, $metadata)
 {
     if (empty($metadata['URL'])) {
         return;
     }
     $assetDir = '../../' . self::getCleanedBasepath($asset);
     $symlink = self::getDownloadedViewPath($bucket, $metadata['URL']);
     if (!self::$lastModified) {
         self::$lastModified = new binarypool_lastmodified();
     }
     $lastmodified = self::$lastModified->lastModified($bucket, $metadata['URL']);
     if ($lastmodified['cache_age'] > binarypool_config::getCacheRevalidate($bucket)) {
         self::refreshLink($bucket, $assetDir, $symlink);
     } else {
         self::createLink($bucket, $assetDir, $symlink);
     }
 }