当前位置: 首页>>代码示例>>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;未经允许,请勿转载。