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


PHP Share::getBackend方法代码示例

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


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

示例1: foreach

                            }
                        }
                    }
                    $count = 0;
                    // enable l10n support
                    $l = \OC::$server->getL10N('core');
                    foreach ($groups as $group) {
                        if ($count < 15) {
                            if (!isset($_GET['itemShares']) || !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !is_array((string) $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !in_array($group, (string) $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])) {
                                $shareWith[] = array('label' => $group, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_GROUP, 'shareWith' => $group));
                                $count++;
                            }
                        } else {
                            break;
                        }
                    }
                    // allow user to add unknown remote addresses for server-to-server share
                    $backend = \OCP\Share::getBackend((string) $_GET['itemType']);
                    if ($backend->isShareTypeAllowed(\OCP\Share::SHARE_TYPE_REMOTE)) {
                        if (substr_count((string) $_GET['search'], '@') === 1) {
                            $shareWith[] = array('label' => (string) $_GET['search'], 'value' => array('shareType' => \OCP\Share::SHARE_TYPE_REMOTE, 'shareWith' => (string) $_GET['search']));
                        }
                    }
                    $sorter = new \OC\Share\SearchResultSorter((string) $_GET['search'], 'label', new \OC\Log());
                    usort($shareWith, array($sorter, 'sort'));
                    OC_JSON::success(array('data' => $shareWith));
                }
                break;
        }
    }
}
开发者ID:heldernl,项目名称:owncloud8-extended,代码行数:31,代码来源:share.php

示例2: isRemoteSharingAllowed

 /**
  * Method to get out the static call for better testing
  *
  * @param string $itemType
  * @return bool
  */
 protected function isRemoteSharingAllowed($itemType)
 {
     try {
         $backend = Share::getBackend($itemType);
         return $backend->isShareTypeAllowed(Share::SHARE_TYPE_REMOTE);
     } catch (\Exception $e) {
         return false;
     }
 }
开发者ID:gvde,项目名称:core,代码行数:15,代码来源:sharees.php

示例3: getAll

 /**
  * get all file ids on the files on the storage
  *
  * @return int[]
  */
 public function getAll()
 {
     $ids = \OCP\Share::getItemsSharedWith('file', \OC_Share_Backend_File::FORMAT_GET_ALL);
     $folderBackend = \OCP\Share::getBackend('folder');
     if ($folderBackend instanceof Share_Backend_Collection) {
         foreach ($ids as $file) {
             /** @var $folderBackend Share_Backend_Collection */
             $children = $folderBackend->getChildren($file);
             foreach ($children as $child) {
                 $ids[] = (int) $child['source'];
             }
         }
     }
     return $ids;
 }
开发者ID:Combustible,项目名称:core,代码行数:20,代码来源:cache.php

示例4: foreach

                            }
                        }
                    }
                    $count = 0;
                    // enable l10n support
                    $l = \OC::$server->getL10N('core');
                    foreach ($groups as $group) {
                        if ($count < 15) {
                            if (!isset($_GET['itemShares']) || !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])) {
                                $shareWith[] = array('label' => $group, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_GROUP, 'shareWith' => $group));
                                $count++;
                            }
                        } else {
                            break;
                        }
                    }
                    // allow user to add unknown remote addresses for server-to-server share
                    $backend = \OCP\Share::getBackend($_GET['itemType']);
                    if ($backend->isShareTypeAllowed(\OCP\Share::SHARE_TYPE_REMOTE)) {
                        if (substr_count($_GET['search'], '@') === 1) {
                            $shareWith[] = array('label' => $_GET['search'], 'value' => array('shareType' => \OCP\Share::SHARE_TYPE_REMOTE, 'shareWith' => $_GET['search']));
                        }
                    }
                    $sorter = new \OC\Share\SearchResultSorter($_GET['search'], 'label', new \OC\Log());
                    usort($shareWith, array($sorter, 'sort'));
                    OC_JSON::success(array('data' => $shareWith));
                }
                break;
        }
    }
}
开发者ID:kebenxiaoming,项目名称:owncloudRedis,代码行数:31,代码来源:share.php


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