Exemplo n.º 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;
 }