當前位置: 首頁>>代碼示例>>PHP>>正文


PHP View::getETag方法代碼示例

本文整理匯總了PHP中OC\Files\View::getETag方法的典型用法代碼示例。如果您正苦於以下問題:PHP View::getETag方法的具體用法?PHP View::getETag怎麽用?PHP View::getETag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OC\Files\View的用法示例。


在下文中一共展示了View::getETag方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPreview

 /**
  * @param string $owner
  * @param int $fileId
  * @param string $filePath
  * @return array
  */
 protected function getPreview($owner, $fileId, $filePath)
 {
     $info = $this->infoCache->getInfoById($owner, $fileId, $filePath);
     if (!$info['exists'] || $info['view'] !== '') {
         return $this->getPreviewFromPath($filePath, $info);
     }
     $preview = ['link' => $this->getPreviewLink($info['path'], $info['is_dir'], $info['view']), 'source' => '', 'isMimeTypeIcon' => true];
     // show a preview image if the file still exists
     if ($info['is_dir']) {
         $preview['source'] = $this->getPreviewPathFromMimeType('dir');
     } else {
         $this->view->chroot('/' . $owner . '/files');
         $fileInfo = $this->view->getFileInfo($info['path']);
         if (!$fileInfo instanceof FileInfo) {
             $pathPreview = $this->getPreviewFromPath($filePath, $info);
             $preview['source'] = $pathPreview['source'];
         } else {
             if ($this->preview->isAvailable($fileInfo)) {
                 $preview['isMimeTypeIcon'] = false;
                 $preview['source'] = $this->urlGenerator->linkToRoute('core_ajax_preview', ['file' => $info['path'], 'c' => $this->view->getETag($info['path']), 'x' => 150, 'y' => 150]);
             } else {
                 $preview['source'] = $this->getPreviewPathFromMimeType($fileInfo->getMimetype());
             }
         }
     }
     return $preview;
 }
開發者ID:drognisep,項目名稱:Portfolio-Site,代碼行數:33,代碼來源:OCSEndPoint.php

示例2: getPreview

 /**
  * @param string $owner
  * @param int $fileId
  * @param string $filePath
  * @return array
  */
 protected function getPreview($owner, $fileId, $filePath)
 {
     $this->view->chroot('/' . $owner . '/files');
     $path = $this->view->getPath($fileId);
     if ($path === null || $path === '' || !$this->view->file_exists($path)) {
         return $this->getPreviewFromPath($filePath);
     }
     $is_dir = $this->view->is_dir($path);
     $preview = ['link' => $this->getPreviewLink($path, $is_dir), 'source' => '', 'isMimeTypeIcon' => true];
     // show a preview image if the file still exists
     if ($is_dir) {
         $preview['source'] = $this->getPreviewPathFromMimeType('dir');
     } else {
         $fileInfo = $this->view->getFileInfo($path);
         if ($this->preview->isAvailable($fileInfo)) {
             $preview['isMimeTypeIcon'] = false;
             $preview['source'] = $this->urlGenerator->linkToRoute('core_ajax_preview', ['file' => $path, 'c' => $this->view->getETag($path), 'x' => 150, 'y' => 150]);
         } else {
             $preview['source'] = $this->getPreviewPathFromMimeType($fileInfo->getMimetype());
         }
     }
     return $preview;
 }
開發者ID:enoch85,項目名稱:owncloud-testserver,代碼行數:29,代碼來源:activities.php

示例3: getETag

 /**
  * get the ETag for a file or folder
  *
  * @param string $path
  * @return string
  */
 public static function getETag($path)
 {
     return self::$defaultInstance->getETag($path);
 }
開發者ID:stweil,項目名稱:owncloud-core,代碼行數:10,代碼來源:Filesystem.php


注:本文中的OC\Files\View::getETag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。