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


PHP Helper::getShareFolder方法代码示例

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


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

示例1: generateTarget

 /**
  * create unique target
  * @param string $filePath
  * @param string $shareWith
  * @param string $exclude
  * @return string
  */
 public function generateTarget($filePath, $shareWith, $exclude = null)
 {
     $shareFolder = \OCA\Files_Sharing\Helper::getShareFolder();
     $target = \OC\Files\Filesystem::normalizePath($shareFolder . '/' . basename($filePath));
     // for group shares we return the target right away
     if ($shareWith === false) {
         return $target;
     }
     \OC\Files\Filesystem::initMountPoints($shareWith);
     $view = new \OC\Files\View('/' . $shareWith . '/files');
     if (!$view->is_dir($shareFolder)) {
         $dir = '';
         $subdirs = explode('/', $shareFolder);
         foreach ($subdirs as $subdir) {
             $dir = $dir . '/' . $subdir;
             if (!$view->is_dir($dir)) {
                 $view->mkdir($dir);
             }
         }
     }
     $excludeList = \OCP\Share::getItemsSharedWithUser('file', $shareWith, self::FORMAT_TARGET_NAMES);
     if (is_array($exclude)) {
         $excludeList = array_merge($excludeList, $exclude);
     }
     return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view);
 }
开发者ID:Combustible,项目名称:core,代码行数:33,代码来源:file.php

示例2: testSetGetShareFolder

 /**
  * test set and get share folder
  */
 function testSetGetShareFolder()
 {
     $this->assertSame('/', \OCA\Files_Sharing\Helper::getShareFolder());
     \OCA\Files_Sharing\Helper::setShareFolder('/Shared');
     $this->assertSame('/Shared', \OCA\Files_Sharing\Helper::getShareFolder());
     // cleanup
     \OCP\Config::deleteSystemValue('share_folder');
 }
开发者ID:Romua1d,项目名称:core,代码行数:11,代码来源:helper.php

示例3: testSetGetShareFolder

 /**
  * test set and get share folder
  */
 function testSetGetShareFolder()
 {
     $this->assertSame('/', \OCA\Files_Sharing\Helper::getShareFolder());
     \OCA\Files_Sharing\Helper::setShareFolder('/Shared/Folder');
     $sharedFolder = \OCA\Files_Sharing\Helper::getShareFolder();
     $this->assertSame('/Shared/Folder', \OCA\Files_Sharing\Helper::getShareFolder());
     $this->assertTrue(\OC\Files\Filesystem::is_dir($sharedFolder));
     // cleanup
     \OCP\Config::deleteSystemValue('share_folder');
 }
开发者ID:droiter,项目名称:openwrt-on-android,代码行数:13,代码来源:helper.php

示例4: verifyMountPoint

 /**
  * check if the parent folder exists otherwise move the mount point up
  *
  * @param \OCP\Share\IShare $share
  * @param SharedMount[] $mountpoints
  * @return string
  */
 private function verifyMountPoint(\OCP\Share\IShare $share, array $mountpoints)
 {
     $mountPoint = basename($share->getTarget());
     $parent = dirname($share->getTarget());
     if (!$this->recipientView->is_dir($parent)) {
         $parent = Helper::getShareFolder();
     }
     $newMountPoint = $this->generateUniqueTarget(\OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint), $this->recipientView, $mountpoints);
     if ($newMountPoint !== $share->getTarget()) {
         $this->updateFileTarget($newMountPoint, $share);
     }
     return $newMountPoint;
 }
开发者ID:stweil,项目名称:owncloud-core,代码行数:20,代码来源:sharedmount.php

示例5: verifyMountPoint

 /**
  * check if the parent folder exists otherwise move the mount point up
  *
  * @param array $share
  * @return string
  */
 private function verifyMountPoint(&$share)
 {
     $mountPoint = basename($share['file_target']);
     $parent = dirname($share['file_target']);
     if (!$this->recipientView->is_dir($parent)) {
         $parent = Helper::getShareFolder();
     }
     $newMountPoint = \OCA\Files_Sharing\Helper::generateUniqueTarget(\OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint), [], $this->recipientView);
     if ($newMountPoint !== $share['file_target']) {
         $this->updateFileTarget($newMountPoint, $share);
         $share['file_target'] = $newMountPoint;
         $share['unique_name'] = true;
     }
     return $newMountPoint;
 }
开发者ID:DanielTosello,项目名称:owncloud,代码行数:21,代码来源:sharedmount.php

示例6: verifyMountPoint

 /**
  * check if the parent folder exists otherwise move the mount point up
  */
 private function verifyMountPoint(&$share, $user)
 {
     $mountPoint = basename($share['file_target']);
     $parent = dirname($share['file_target']);
     if (!\OC\Files\Filesystem::is_dir($parent)) {
         $parent = Helper::getShareFolder();
     }
     $newMountPoint = \OCA\Files_Sharing\Helper::generateUniqueTarget(\OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint), array(), new \OC\Files\View('/' . $user . '/files'));
     if ($newMountPoint !== $share['file_target']) {
         self::updateFileTarget($newMountPoint, $share);
         $share['file_target'] = $newMountPoint;
         $share['unique_name'] = true;
     }
     return $newMountPoint;
 }
开发者ID:adolfo2103,项目名称:hcloudfilem,代码行数:18,代码来源:sharedmount.php


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