本文整理汇总了PHP中OCP\Files\Folder::getFullPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::getFullPath方法的具体用法?PHP Folder::getFullPath怎么用?PHP Folder::getFullPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\Files\Folder
的用法示例。
在下文中一共展示了Folder::getFullPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* Start delta sync upload
*
* @param string $path
* @param int $size the new size of the file
*/
public function start($path, $size)
{
$np = $path . '.new';
$npf = $this->userFolder->getFullPath($np);
try {
$node = $this->userFolder->get($path);
} catch (\OCP\Files\NotFoundException $exception) {
return new JSONResponse([], Http::STATUS_NOT_FOUND);
}
$node->copy($npf);
$node = $this->userFolder->get($np);
$file = $node->fopen('r+');
$res = ftruncate($file, $size);
if (!$res) {
//Truncate failed
}
fclose($file);
return new JSONResponse($size);
}
示例2: copySkeleton
/**
* copies the skeleton to the users /files
*
* @param \OC\User\User $user
* @param \OCP\Files\Folder $userDirectory
*/
public static function copySkeleton(\OC\User\User $user, \OCP\Files\Folder $userDirectory) {
$skeletonDirectory = \OCP\Config::getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton');
if (!empty($skeletonDirectory)) {
\OCP\Util::writeLog(
'files_skeleton',
'copying skeleton for '.$user->getUID().' from '.$skeletonDirectory.' to '.$userDirectory->getFullPath('/'),
\OCP\Util::DEBUG
);
self::copyr($skeletonDirectory, $userDirectory);
// update the file cache
$userDirectory->getStorage()->getScanner()->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE);
}
}