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


PHP Folder::getPath方法代碼示例

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


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

示例1: pathCreateChecks

 /**
  * @param File|Folder $path
  */
 protected function pathCreateChecks($path)
 {
     // Make sure that we do not share a path that contains a shared mountpoint
     if ($path instanceof \OCP\Files\Folder) {
         $mounts = $this->mountManager->findIn($path->getPath());
         foreach ($mounts as $mount) {
             if ($mount->getStorage()->instanceOfStorage('\\OCA\\Files_Sharing\\ISharedStorage')) {
                 throw new \InvalidArgumentException('Path contains files shared with you');
             }
         }
     }
 }
開發者ID:RomanKreisel,項目名稱:core,代碼行數:15,代碼來源:manager.php

示例2: isRootFolder

 /**
  * Determines if we've reached the root folder
  *
  * @param Folder $folder
  * @param int $level
  *
  * @return bool
  */
 protected function isRootFolder($folder, $level)
 {
     $isRootFolder = false;
     $rootFolder = $this->environment->getVirtualRootFolder();
     if ($folder->getPath() === $rootFolder->getPath()) {
         $isRootFolder = true;
     }
     $virtualRootFolder = $this->environment->getPathFromVirtualRoot($folder);
     if (empty($virtualRootFolder)) {
         $this->virtualRootLevel = $level;
     }
     return $isRootFolder;
 }
開發者ID:efueger,項目名稱:galleryplus,代碼行數:21,代碼來源:filesservice.php

示例3: getRelativePath

 /**
  * Returns the path which goes from the file, up to the user folder, based on a path:
  * parent_folder/current_folder/my_file
  *
  * getPath() on the file produces a path like:
  * '/userId/files/my_folder/my_sub_folder/my_file'
  *
  * So we substract the path to the user folder, giving us a relative path
  * 'my_folder/my_sub_folder'
  *
  * @param string $fullPath
  *
  * @return string
  */
 private function getRelativePath($fullPath)
 {
     $folderPath = $this->userFolder->getPath() . '/';
     $origShareRelPath = str_replace($folderPath, '', $fullPath);
     return $origShareRelPath;
 }
開發者ID:enoch85,項目名稱:owncloud-testserver,代碼行數:20,代碼來源:environment.php


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