当前位置: 首页>>代码示例>>PHP>>正文


PHP Share::getAllSharesForFileId方法代码示例

本文整理汇总了PHP中OC\Share\Share::getAllSharesForFileId方法的典型用法代码示例。如果您正苦于以下问题:PHP Share::getAllSharesForFileId方法的具体用法?PHP Share::getAllSharesForFileId怎么用?PHP Share::getAllSharesForFileId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC\Share\Share的用法示例。


在下文中一共展示了Share::getAllSharesForFileId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: content

 /**
  * get file content from file_id
  * @NoCSRFRequired
  */
 public function content($id)
 {
     $cacheInfo = FileCacheDao::getCacheInfo($id);
     //Get file information (storage urn and user)
     $fileInfo = FileCacheDao::getFileInfo($cacheInfo['storage'], $cacheInfo['path']);
     //Get content
     $content = FileCacheDao::getContentByUrn($fileInfo['urn']);
     // Get shares
     $shares = Share::getAllSharesForFileId($id);
     // Return json data
     return new JSONResponse(array('user' => $fileInfo['user'], 'content' => $content, 'path' => $cacheInfo['path'], 'shares' => $shares));
 }
开发者ID:ifremer,项目名称:snanny-owncloudapi,代码行数:16,代码来源:apicontroller.php

示例2: propagateById

 public function propagateById($id)
 {
     if (isset($this->propagatingIds[$id])) {
         return;
     }
     $this->propagatingIds[$id] = true;
     $shares = Share::getAllSharesForFileId($id);
     foreach ($shares as $share) {
         // propagate down the share tree
         $this->markDirty($share, microtime(true));
         // propagate up the share tree
         if ($this->isRecipientOfShare($share)) {
             $user = $share['uid_owner'];
             $view = new View('/' . $user . '/files');
             $path = $view->getPath($share['file_source']);
             $watcher = new ChangeWatcher($view, $this->manager->getSharePropagator($user));
             $watcher->writeHook(['path' => $path]);
         }
     }
     unset($this->propagatingIds[$id]);
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:21,代码来源:recipientpropagator.php

示例3: propagateById

 public function propagateById($id)
 {
     $shares = Share::getAllSharesForFileId($id);
     foreach ($shares as $share) {
         // propagate down the share tree
         $this->markDirty($share, microtime(true));
         // propagate up the share tree
         if ($share['share_with'] === $this->userId) {
             $user = $share['uid_owner'];
             $view = new View('/' . $user . '/files');
             $path = $view->getPath($share['file_source']);
             $watcher = new ChangeWatcher($view, $this->manager->getSharePropagator($user));
             $watcher->writeHook(['path' => $path]);
         }
     }
 }
开发者ID:GrumpyCrouton,项目名称:core,代码行数:16,代码来源:recipientpropagator.php

示例4: attachToPropagator

 /**
  * Listen on the propagator for updates made to shares owned by a user
  *
  * @param \OC\Files\Cache\ChangePropagator $propagator
  * @param string $owner
  */
 public function attachToPropagator(ChangePropagator $propagator, $owner)
 {
     $propagator->listen('\\OC\\Files', 'propagate', function ($path, $entry) use($owner) {
         $shares = Share::getAllSharesForFileId($entry['fileid']);
         foreach ($shares as $share) {
             // propagate down the share tree
             $this->markDirty($share, microtime(true));
             // propagate up the share tree
             $user = $share['uid_owner'];
             $view = new View('/' . $user . '/files');
             $path = $view->getPath($share['file_source']);
             $watcher = new ChangeWatcher($view);
             $watcher->writeHook(['path' => $path]);
         }
     });
 }
开发者ID:brunomilet,项目名称:owncloud-core,代码行数:22,代码来源:recipientpropagator.php


注:本文中的OC\Share\Share::getAllSharesForFileId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。