public function unpublish(File $file, Version $version, VersionProvider $versionProvider, Linker $linker)
 {
     $link = $this->getPublicRoot() . '/' . $linker->getLink($file, $version, $versionProvider->getExtension($file, $version));
     if (is_file($link)) {
         unlink($link);
     }
 }
예제 #2
0
 /**
  * @param string $url
  * @return array Tuple of file and version
  * @throws RuntimeException
  */
 public function reverseUrl($url)
 {
     if (!$this->linker instanceof ReversibleLinker) {
         throw new RuntimeException("Reversible linker is needed to reverse an url");
     }
     return $this->linker->reverseLink($url);
 }
 /**
  * @param File $file
  * @param Version $version
  * @param Linker $linker
  * @return string
  */
 public function getUrl(File $file, Version $version, VersionProvider $versionProvider, Linker $linker)
 {
     $url = $this->getBaseUrl() . '/';
     $url .= $linker->getLink($file, $version, $versionProvider->getExtension($file, $version));
     return $url;
 }