예제 #1
0
 /**
  * Store a file or virtual URL source into a media file name.
  *
  * @param $originalName string The title of the image
  * @param $srcPath string The filepath or virtual URL
  * @param $flags integer Flags to pass into repo::store().
  * @return FileRepoStatus
  */
 private function storeit($originalName, $srcPath, $flags)
 {
     $hashPath = $this->repo->getHashPath($originalName);
     $dstRel = "{$hashPath}{$this->date}!{$originalName}";
     $dstUrlRel = $hashPath . $this->date . '!' . rawurlencode($originalName);
     $result = $this->repo->store($srcPath, 'temp', $dstRel, $flags);
     $result->value = $this->repo->getVirtualUrl('temp') . '/' . $dstUrlRel;
     $this->createdFiles[] = $result->value;
     return $result;
 }
예제 #2
0
파일: File.php 프로젝트: schwarer2006/wikia
 /**
  * Get the virtual URL for a thumbnail file or directory
  *
  * @param $suffix bool|string if not false, the name of a thumbnail file
  *
  * @return string
  */
 function getThumbVirtualUrl($suffix = false)
 {
     $this->assertRepoDefined();
     $path = $this->repo->getVirtualUrl() . '/thumb/' . $this->getUrlRel();
     if ($suffix !== false) {
         $path .= '/' . rawurlencode($suffix);
     }
     return $path;
 }