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


PHP ConfService::findRepositoryByIdOrAlias方法代码示例

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


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

示例1: initRepositoriesListInst

 /**
  * @param $scope String "user", "all"
  * @param bool $includeShared
  * @return array
  */
 protected function initRepositoriesListInst($scope = "user", $includeShared = true)
 {
     // APPEND CONF FILE REPOSITORIES
     $loggedUser = AuthService::getLoggedUser();
     $objList = array();
     if ($loggedUser != null) {
         $l = $loggedUser->getLock();
         if (!empty($l)) {
             return $objList;
         }
     }
     foreach ($this->configs["DEFAULT_REPOSITORIES"] as $index => $repository) {
         $repo = self::createRepositoryFromArray($index, $repository);
         if ($scope == "user" && $loggedUser != null && !self::repositoryIsAccessible($index, $repo, $loggedUser)) {
             continue;
         }
         $repo->setWriteable(false);
         $objList["" . $repo->getId()] = $repo;
     }
     // LOAD FROM DRIVER
     $confDriver = self::getConfStorageImpl();
     if ($scope == "user") {
         $acls = array();
         if (AuthService::getLoggedUser() != null) {
             $acls = AuthService::getLoggedUser()->mergedRole->listAcls(true);
         }
         if (!count($acls)) {
             $drvList = array();
         } else {
             $criteria = array("uuid" => array_keys($acls));
             $drvList = $confDriver->listRepositoriesWithCriteria($criteria);
         }
     } else {
         if ($includeShared) {
             $drvList = $confDriver->listRepositories();
         } else {
             $drvList = $confDriver->listRepositoriesWithCriteria(array("owner_user_id" => AJXP_FILTER_EMPTY));
         }
     }
     if (is_array($drvList)) {
         /**
          * @var $drvList Repository[]
          */
         foreach ($drvList as $repoId => $repoObject) {
             $driver = AJXP_PluginsService::getInstance()->getPluginByTypeName("access", $repoObject->getAccessType());
             if (!is_object($driver) || !$driver->isEnabled()) {
                 unset($drvList[$repoId]);
             } else {
                 $repoObject->setId($repoId);
                 $drvList[$repoId] = $repoObject;
             }
             if ($repoObject->hasParent() && !ConfService::findRepositoryByIdOrAlias($repoObject->getParentId())) {
                 AJXP_Logger::error(__CLASS__, __FUNCTION__, "Disabling repository " . $repoObject->getSlug() . " as parent cannot be correctly loaded.");
                 unset($drvList[$repoId]);
             }
         }
         foreach ($drvList as $key => $value) {
             $objList[$key] = $value;
         }
     }
     $args = array(&$objList);
     AJXP_Controller::applyIncludeHook("sec.access_ws", $args);
     return $objList;
 }
开发者ID:ad-m,项目名称:pydio-core,代码行数:69,代码来源:class.ConfService.php

示例2: session_name

$confPlugin = ConfService::getInstance()->confPluginSoftLoad($pServ);
$pServ->loadPluginsRegistry(AJXP_INSTALL_PATH . "/plugins", $confPlugin);
ConfService::start();
$confStorageDriver = ConfService::getConfStorageImpl();
require_once $confStorageDriver->getUserClassFileName();
session_name("AjaXplorer");
session_start();
AuthService::$useSession = false;
AuthService::logUser(AJXP_API_USER, "", true);
$authDriver = ConfService::getAuthDriverImpl();
$uri = $_SERVER["REQUEST_URI"];
$scriptUri = ltrim(dirname($_SERVER["SCRIPT_NAME"]), '/') . "/api/";
$uri = substr($uri, strlen($scriptUri));
$uri = explode("/", $uri);
// GET REPO ID
$repoID = array_shift($uri);
// GET ACTION NAME
$action = array_shift($uri);
$path = "/" . implode("/", $uri);
$repo =& ConfService::findRepositoryByIdOrAlias($repoID);
if ($repo == null) {
    die("Cannot find repository with ID " . $repoID);
}
ConfService::switchRootDir($repo->getId());
// DRIVERS BELOW NEED IDENTIFICATION CHECK
if (!AuthService::usersEnabled() || ConfService::getCoreConf("ALLOW_GUEST_BROWSING", "auth") || AuthService::getLoggedUser() != null) {
    $confDriver = ConfService::getConfStorageImpl();
    $Driver = ConfService::loadDriverForRepository($repo);
}
AJXP_PluginsService::getInstance()->initActivePlugins();
AJXP_Controller::findRestActionAndApply($action, $path);
开发者ID:biggtfish,项目名称:cms,代码行数:31,代码来源:rest.php


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