當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。