本文整理匯總了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');
}
}
}
}
示例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;
}
示例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;
}