Beispiel #1
0
 /**
  * Get the path of the thumbnail directory, or a particular file if $suffix is specified
  *
  * @param $suffix bool|string if not false, the name of a thumbnail file
  *
  * @return string
  */
 function getThumbPath($suffix = false)
 {
     $path = $this->repo->getZonePath('thumb') . '/' . $this->getRel();
     if ($suffix !== false) {
         $path .= '/' . $suffix;
     }
     return $path;
 }
Beispiel #2
0
 /**
  * Output the chunk to disk
  *
  * @param string $chunkPath
  * @throws UploadChunkFileException
  * @return FileRepoStatus
  */
 private function outputChunk($chunkPath)
 {
     // Key is fileKey + chunk index
     $fileKey = $this->getChunkFileKey();
     // Store the chunk per its indexed fileKey:
     $hashPath = $this->repo->getHashPath($fileKey);
     $storeStatus = $this->repo->quickImport($chunkPath, $this->repo->getZonePath('temp') . "/{$hashPath}{$fileKey}");
     // Check for error in stashing the chunk:
     if (!$storeStatus->isOK()) {
         $error = $storeStatus->getErrorsArray();
         $error = reset($error);
         if (!count($error)) {
             $error = $storeStatus->getWarningsArray();
             $error = reset($error);
             if (!count($error)) {
                 $error = array('unknown', 'no error recorded');
             }
         }
         throw new UploadChunkFileException("Error storing file in '{$chunkPath}': " . implode('; ', $error));
     }
     return $storeStatus;
 }
Beispiel #3
0
 /**
  * Get the path of the transcoded directory, or a particular file if $suffix is specified
  *
  * @param bool|string $suffix If not false, the name of a media file
  * @return string
  */
 function getTranscodedPath($suffix = false)
 {
     $this->assertRepoDefined();
     return $this->repo->getZonePath('transcoded') . '/' . $this->getThumbRel($suffix);
 }