本文整理汇总了PHP中OC\Files\View::getOwner方法的典型用法代码示例。如果您正苦于以下问题:PHP View::getOwner方法的具体用法?PHP View::getOwner怎么用?PHP View::getOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC\Files\View
的用法示例。
在下文中一共展示了View::getOwner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shareNotificationForOriginalOwners
/**
* Add notifications for the owners whose files have been reshared
*
* @param string $currentOwner
* @param string $subject
* @param string $shareWith
* @param int $fileSource
* @param string $itemType
*/
protected function shareNotificationForOriginalOwners($currentOwner, $subject, $shareWith, $fileSource, $itemType)
{
// Get the full path of the current user
$this->view->chroot('/' . $currentOwner . '/files');
try {
$path = $this->view->getPath($fileSource);
} catch (NotFoundException $e) {
return;
}
/**
* Get the original owner and his path
*/
$owner = $this->view->getOwner($path);
if ($owner !== $currentOwner) {
$this->reshareNotificationForSharer($owner, $subject, $shareWith, $fileSource, $itemType);
}
/**
* Get the sharee who shared the item with the currentUser
*/
$this->view->chroot('/' . $currentOwner . '/files');
$mount = $this->view->getMount($path);
if (!$mount instanceof IMountPoint) {
return;
}
$storage = $mount->getStorage();
if (!$storage->instanceOfStorage('OC\\Files\\Storage\\Shared')) {
return;
}
/** @var \OC\Files\Storage\Shared $storage */
$shareOwner = $storage->getSharedFrom();
if ($shareOwner === '' || $shareOwner === null || $shareOwner === $owner || $shareOwner === $currentOwner) {
return;
}
$this->reshareNotificationForSharer($shareOwner, $subject, $shareWith, $fileSource, $itemType);
}
示例2: getOwner
/**
* Get the owner for a file or folder
*
* @param string $path
* @return string
*/
public static function getOwner($path)
{
return self::$defaultInstance->getOwner($path);
}
示例3: logError
/**
* @param string $message
* @param int $id optional
* @param string $path optional
*/
public function logError($message, $id = null, $path = null)
{
$ownerInfo = is_null($this->view) ? '' : 'Account: ' . $this->view->getOwner($path);
$extra = ' File: ' . (is_null($id) ? $this->id : $id) . $ownerInfo . ' Path: ' . (is_null($path) ? $this->path : $path);
\OCP\Util::writeLog('files_antivirus', $message . $extra, \OCP\Util::ERROR);
}