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


PHP View::getOwner方法代碼示例

本文整理匯總了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);
 }
開發者ID:arietimmerman,項目名稱:activity,代碼行數:44,代碼來源:fileshooks.php

示例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);
 }
開發者ID:stweil,項目名稱:owncloud-core,代碼行數:10,代碼來源:Filesystem.php

示例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);
 }
開發者ID:drognisep,項目名稱:Portfolio-Site,代碼行數:11,代碼來源:item.php


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