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


PHP ConfService::listRepositoriesWithCriteria方法代码示例

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


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

示例1: listShares

 public function listShares($limitToUser = '', $parentRepository = '', $cursor = null, $shareType = null)
 {
     $dbLets = array();
     if ($this->sqlSupported) {
         // Get DB files
         $dbLets = $this->confStorage->simpleStoreList("share", $cursor, "", "serial", !empty($limitToUser) ? '%"OWNER_ID";s:' . strlen($limitToUser) . ':"' . $limitToUser . '"%' : '', $parentRepository);
     }
     // Get hardcoded files
     $files = glob(ConfService::getCoreConf("PUBLIC_DOWNLOAD_FOLDER") . "/*.php");
     if ($files === false) {
         return $dbLets;
     }
     foreach ($files as $file) {
         if (basename($file) == "share.php") {
             continue;
         }
         $ar = explode(".", basename($file));
         $id = array_shift($ar);
         $publicletData = $this->loadShare($id);
         if ($publicletData === false) {
             continue;
         }
         if (!empty($limitToUser) && (!isset($publicletData["OWNER_ID"]) || $publicletData["OWNER_ID"] != $limitToUser)) {
             continue;
         }
         if (!empty($parentRepository) && (is_string($publicletData["REPOSITORY"]) && $publicletData["REPOSITORY"] != $parentRepository || is_object($publicletData["REPOSITORY"]) && $publicletData["REPOSITORY"]->getUniqueId() != $parentRepository)) {
             continue;
         }
         $publicletData["SHARE_TYPE"] = "file";
         $dbLets[$id] = $publicletData;
     }
     // Update share_type and filter if necessary
     foreach ($dbLets as $id => &$shareData) {
         if ($shareData === false) {
             unset($dbLets[$id]);
             continue;
         }
         $this->updateShareType($shareData);
         if (!empty($shareType) && $shareData["SHARE_TYPE"] != $shareType) {
             unset($dbLets[$id]);
         }
     }
     if (empty($shareType) || $shareType == "repository") {
         // BACKWARD COMPATIBILITY: collect old-school shared repositories that are not yet stored in simpleStore
         $storedIds = array();
         foreach ($dbLets as $share) {
             if (empty($limitToUser) || $limitToUser == $share["OWNER_ID"]) {
                 if (is_string($share["REPOSITORY"])) {
                     $storedIds[] = $share["REPOSITORY"];
                 } else {
                     if (is_object($share["REPOSITORY"])) {
                         $storedIds[] = $share["REPOSITORY"]->getUniqueId();
                     }
                 }
             }
         }
         // Find repositories that would have a parent
         $criteria = array();
         $criteria["parent_uuid"] = $parentRepository == "" ? AJXP_FILTER_NOT_EMPTY : $parentRepository;
         $criteria["owner_user_id"] = $limitToUser == "" ? AJXP_FILTER_NOT_EMPTY : $limitToUser;
         if (count($storedIds)) {
             $criteria["!uuid"] = $storedIds;
         }
         $oldRepos = ConfService::listRepositoriesWithCriteria($criteria, $count);
         foreach ($oldRepos as $sharedWorkspace) {
             if (!$sharedWorkspace->hasContentFilter()) {
                 $dbLets['repo-' . $sharedWorkspace->getId()] = array("SHARE_TYPE" => "repository", "OWNER_ID" => $sharedWorkspace->getOwner(), "REPOSITORY" => $sharedWorkspace->getUniqueId(), "LEGACY_REPO_OR_MINI" => true);
                 //Auto Migrate? boaf.
                 //$this->storeShare($sharedWorkspace->getParentId(), $data, "repository");
             }
         }
     }
     return $dbLets;
 }
开发者ID:ad-m,项目名称:pydio-core,代码行数:74,代码来源:class.ShareStore.php

示例2: switchAction


//.........这里部分代码省略.........
                 }
             }
             $prefs = array("webdav_active" => $webdavActive, "password_set" => $passSet, "digest_set" => $digestSet, "webdav_force_basic" => ConfService::getCoreConf("WEBDAV_FORCE_BASIC") === true, "webdav_base_url" => $webdavBaseUrl, "webdav_repositories" => $davRepos);
             HTMLWriter::charsetHeader("application/json");
             print json_encode($prefs);
             break;
         case "get_user_template_logo":
             $tplId = $httpVars["template_id"];
             $iconFormat = $httpVars["icon_format"];
             $repo = ConfService::getRepositoryById($tplId);
             $logo = $repo->getOption("TPL_ICON_" . strtoupper($iconFormat));
             if (isset($logo) && is_file(AJXP_DATA_PATH . "/plugins/core.conf/tpl_logos/" . $logo)) {
                 header("Content-Type: " . AJXP_Utils::getImageMimeType($logo) . "; name=\"" . $logo . "\"");
                 header("Content-Length: " . filesize(AJXP_DATA_PATH . "/plugins/core.conf/tpl_logos/" . $logo));
                 header('Pragma:');
                 header('Cache-Control: public');
                 header("Last-Modified: " . gmdate("D, d M Y H:i:s", time() - 10000) . " GMT");
                 header("Expires: " . gmdate("D, d M Y H:i:s", time() + 5 * 24 * 3600) . " GMT");
                 readfile(AJXP_DATA_PATH . "/plugins/core.conf/tpl_logos/" . $logo);
             } else {
                 $logo = "default_template_logo-" . ($iconFormat == "small" ? 16 : 22) . ".png";
                 header("Content-Type: " . AJXP_Utils::getImageMimeType($logo) . "; name=\"" . $logo . "\"");
                 header("Content-Length: " . filesize(AJXP_INSTALL_PATH . "/" . AJXP_PLUGINS_FOLDER . "/core.conf/" . $logo));
                 header('Pragma:');
                 header('Cache-Control: public');
                 header("Last-Modified: " . gmdate("D, d M Y H:i:s", time() - 10000) . " GMT");
                 header("Expires: " . gmdate("D, d M Y H:i:s", time() + 5 * 24 * 3600) . " GMT");
                 readfile(AJXP_INSTALL_PATH . "/" . AJXP_PLUGINS_FOLDER . "/core.conf/" . $logo);
             }
             break;
         case "get_user_templates_definition":
             AJXP_XMLWriter::header("repository_templates");
             $count = 0;
             $repositories = ConfService::listRepositoriesWithCriteria(array("isTemplate" => 1), $count);
             $pServ = AJXP_PluginsService::getInstance();
             foreach ($repositories as $repo) {
                 if (!$repo->isTemplate) {
                     continue;
                 }
                 if (!$repo->getOption("TPL_USER_CAN_CREATE")) {
                     continue;
                 }
                 $repoId = $repo->getId();
                 $repoLabel = $repo->getDisplay();
                 $repoType = $repo->getAccessType();
                 print "<template repository_id=\"{$repoId}\" repository_label=\"{$repoLabel}\" repository_type=\"{$repoType}\">";
                 $driverPlug = $pServ->getPluginByTypeName("access", $repoType);
                 $params = $driverPlug->getManifestRawContent("//param", "node");
                 $tplDefined = $repo->getOptionsDefined();
                 $defaultLabel = '';
                 foreach ($params as $paramNode) {
                     $name = $paramNode->getAttribute("name");
                     if (strpos($name, "TPL_") === 0) {
                         if ($name == "TPL_DEFAULT_LABEL") {
                             $defaultLabel = str_replace("AJXP_USER", AuthService::getLoggedUser()->getId(), $repo->getOption($name));
                         }
                         continue;
                     }
                     if (in_array($paramNode->getAttribute("name"), $tplDefined)) {
                         continue;
                     }
                     if ($paramNode->getAttribute('no_templates') == 'true') {
                         continue;
                     }
                     print AJXP_XMLWriter::replaceAjxpXmlKeywords($paramNode->ownerDocument->saveXML($paramNode));
                 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:67,代码来源:class.AbstractConfDriver.php

示例3: runTask

 public function runTask($taskId, $status = null, &$currentlyRunning = -1, $forceStart = false)
 {
     $data = $this->getTaskById($taskId);
     $mess = ConfService::getMessages();
     $timeArray = $this->getTimeArray($data["schedule"]);
     // TODO : Set MasterInterval as config, or detect last execution?
     $masterInterval = 1;
     $maximumProcesses = 2;
     $now = time();
     $lastExec = time() - 60 * $masterInterval;
     $res = $this->getNextExecutionTimeForScript($lastExec, $timeArray);
     $test = date("Y-m-d H:i", $lastExec) . " -- " . date("Y-m-d H:i", $res) . " --  " . date("Y-m-d H:i", $now);
     $alreadyRunning = false;
     $queued = false;
     if ($status == null) {
         $status = $this->getTaskStatus($taskId);
     }
     if ($status !== false) {
         if ($status[0] == "RUNNING") {
             $alreadyRunning = true;
         } else {
             if (in_array("QUEUED", $status)) {
                 $queued = true;
                 // Run now !
             }
         }
     }
     if ($res >= $lastExec && $res < $now && !$alreadyRunning && $currentlyRunning >= $maximumProcesses) {
         $this->setTaskStatus($taskId, "QUEUED", true);
         $alreadyRunning = true;
         $queued = false;
     }
     if ($res >= $lastExec && $res < $now && !$alreadyRunning || $queued || $forceStart) {
         if ($data["user_id"] == "*/*" || $data["user_id"] == "*") {
             // Recurse all groups and put them into a queue file
             $allUsers = array();
             if ($data["user_id"] == "*") {
                 $allUsers = $this->listUsersIds();
             } else {
                 $this->gatherUsers($allUsers, "/");
             }
             $tmpQueue = AJXP_CACHE_DIR . "/cmd_outputs/queue_" . $taskId . "";
             echo "Queuing " . count($allUsers) . " users in file " . $tmpQueue . "\n";
             file_put_contents($tmpQueue, implode(",", $allUsers));
             $data["user_id"] = "queue:" . $tmpQueue;
         }
         if ($data["repository_id"] == "*") {
             $criteria = array();
             $criteria["isTemplate"] = false;
             $count = 0;
             $listRepos = ConfService::listRepositoriesWithCriteria($criteria, $count);
             $data["repository_id"] = implode(",", array_keys($listRepos));
         }
         $process = AJXP_Controller::applyActionInBackground($data["repository_id"], $data["action_name"], $data["PARAMS"], $data["user_id"], AJXP_CACHE_DIR . "/cmd_outputs/task_" . $taskId . ".status");
         if ($process != null && is_a($process, "UnixProcess")) {
             $this->setTaskStatus($taskId, "RUNNING:" . $process->getPid());
         } else {
             $this->setTaskStatus($taskId, "RUNNING");
         }
         $currentlyRunning++;
         return true;
     }
     return false;
 }
开发者ID:rbrdevs,项目名称:pydio-core,代码行数:64,代码来源:class.AjxpScheduler.php

示例4: listRepositories

 public function listRepositories($root, $child, $hashValue = null, $returnNodes = false)
 {
     $REPOS_PER_PAGE = 50;
     $allNodes = array();
     if ($hashValue == null) {
         $hashValue = 1;
     }
     $offset = ($hashValue - 1) * $REPOS_PER_PAGE;
     $count = null;
     // Load all repositories = normal, templates, and templates children
     $currentUserIsGroupAdmin = AuthService::getLoggedUser() != null && AuthService::getLoggedUser()->getGroupPath() != "/";
     if ($currentUserIsGroupAdmin) {
         $repos = ConfService::listRepositoriesWithCriteria(array("owner_user_id" => AJXP_FILTER_EMPTY, "groupPath" => "regexp:/^" . str_replace("/", "\\/", AuthService::getLoggedUser()->getGroupPath()) . '/', "ORDERBY" => array("KEY" => "display", "DIR" => "ASC"), "CURSOR" => array("OFFSET" => $offset, "LIMIT" => $REPOS_PER_PAGE)), $count);
     } else {
         $repos = ConfService::listRepositoriesWithCriteria(array("parent_uuid" => AJXP_FILTER_EMPTY, "ORDERBY" => array("KEY" => "display", "DIR" => "ASC"), "CURSOR" => array("OFFSET" => $offset, "LIMIT" => $REPOS_PER_PAGE)), $count);
     }
     if (!$returnNodes) {
         var_dump($count);
         AJXP_XMLWriter::renderPaginationData($count, $hashValue, ceil($count / $REPOS_PER_PAGE));
         AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchDisplayMode="list" switchGridMode="filelist" template_name="ajxp_conf.repositories">
             <column messageId="ajxp_conf.8" attributeName="ajxp_label" sortType="String"/>
             <column messageId="ajxp_conf.9" attributeName="accessType" sortType="String"/>
             <column messageId="ajxp_conf.125" attributeName="slug" sortType="String"/>
         </columns>');
     }
     foreach ($repos as $repoIndex => $repoObject) {
         if ($repoObject->getAccessType() == "ajxp_conf" || $repoObject->getAccessType() == "ajxp_shared") {
             continue;
         }
         if (!AuthService::canAdministrate($repoObject)) {
             continue;
         }
         if (is_numeric($repoIndex)) {
             $repoIndex = "" . $repoIndex;
         }
         $icon = "hdd_external_unmount.png";
         $editable = $repoObject->isWriteable();
         if ($repoObject->isTemplate) {
             $icon = "hdd_external_mount.png";
             if (AuthService::getLoggedUser() != null && AuthService::getLoggedUser()->getGroupPath() != "/") {
                 $editable = false;
             }
         }
         $meta = array("repository_id" => $repoIndex, "accessType" => ($repoObject->isTemplate ? "Template for " : "") . $repoObject->getAccessType(), "icon" => $icon, "owner" => $repoObject->hasOwner() ? $repoObject->getOwner() : "", "openicon" => $icon, "slug" => $repoObject->getSlug(), "parentname" => "/repositories", "ajxp_mime" => "repository" . ($editable ? "_editable" : ""));
         $nodeKey = "/data/repositories/{$repoIndex}";
         if (in_array($nodeKey, $this->currentBookmarks)) {
             $meta = array_merge($meta, array("ajxp_bookmarked" => "true", "overlay_icon" => "bookmark.png"));
         }
         $xml = AJXP_XMLWriter::renderNode($nodeKey, AJXP_Utils::xmlEntities(SystemTextEncoding::toUTF8($repoObject->getDisplay())), true, $meta, true, false);
         if ($returnNodes) {
             $allNodes[$nodeKey] = $xml;
         } else {
             print $xml;
         }
         if ($repoObject->isTemplate) {
             // Now Load children for template repositories
             $children = ConfService::listRepositoriesWithCriteria(array("parent_uuid" => $repoIndex . ""), $count);
             foreach ($children as $childId => $childObject) {
                 if (!AuthService::canAdministrate($childObject)) {
                     continue;
                 }
                 if (is_numeric($childId)) {
                     $childId = "" . $childId;
                 }
                 $meta = array("repository_id" => $childId, "accessType" => $childObject->getAccessType(), "icon" => "repo_child.png", "owner" => $childObject->hasOwner() ? $childObject->getOwner() : "", "openicon" => "repo_child.png", "parentname" => "/repositories", "ajxp_mime" => "repository_editable");
                 $cNodeKey = "/data/repositories/{$childId}";
                 if (in_array($cNodeKey, $this->currentBookmarks)) {
                     $meta = array_merge($meta, array("ajxp_bookmarked" => "true", "overlay_icon" => "bookmark.png"));
                 }
                 $xml = AJXP_XMLWriter::renderNode($cNodeKey, AJXP_Utils::xmlEntities(SystemTextEncoding::toUTF8($childObject->getDisplay())), true, $meta, true, false);
                 if ($returnNodes) {
                     $allNodes[$cNodeKey] = $xml;
                 } else {
                     print $xml;
                 }
             }
         }
     }
 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:79,代码来源:class.ajxp_confAccessDriver.php

示例5: checkRepoWithSameLabel

 /**
  * @param $label
  * @param Repository|null $editingRepo
  * @return bool
  */
 protected function checkRepoWithSameLabel($label, $editingRepo = null)
 {
     if ($this->getFilteredOption("AVOID_SHARED_FOLDER_SAME_LABEL", $this->repository) == true) {
         $count = 0;
         $similarLabelRepos = ConfService::listRepositoriesWithCriteria(array("display" => $label), $count);
         if ($count && !isset($editingRepo)) {
             return true;
         }
         if ($count && isset($editingRepo)) {
             foreach ($similarLabelRepos as $slr) {
                 if ($slr->getUniqueId() != $editingRepo->getUniqueId()) {
                     return true;
                 }
             }
         }
     }
     return false;
 }
开发者ID:Nanomani,项目名称:pydio-core,代码行数:23,代码来源:class.ShareCenter.php

示例6: migrateOldSharedWorkspaces

 public function migrateOldSharedWorkspaces($parentRepositoryId)
 {
     // Load only children of a given repository
     $repos = ConfService::listRepositoriesWithCriteria(array("parent_uuid" => $parentRepositoryId), $count);
     $count = 0;
     foreach ($repos as $repoId => $repoObject) {
         $shares = $this->getShareStore()->findSharesForRepo($repoId);
         if (!count($shares)) {
             $count++;
             $this->getShareStore()->storeShare($parentRepositoryId, array("REPOSITORY" => $repoObject->getUniqueId(), "OWNER_ID" => $repoObject->getOwner()), "repository");
         }
     }
     return $count;
 }
开发者ID:saydulk,项目名称:pydio-core,代码行数:14,代码来源:class.ShareCenter.php

示例7: listRepositories

 public function listRepositories()
 {
     AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist"><column messageId="ajxp_conf.8" attributeName="ajxp_label" sortType="String"/><column messageId="user_dash.9" attributeName="parent_label" sortType="String"/><column messageId="user_dash.9" attributeName="repo_accesses" sortType="String"/></columns>');
     $repoArray = array();
     $loggedUser = AuthService::getLoggedUser();
     $count = 0;
     $repos = ConfService::listRepositoriesWithCriteria(array("owner_user_id" => $loggedUser->getId()), $count);
     $searchAll = ConfService::getCoreConf("CROSSUSERS_ALLGROUPS", "conf");
     $displayAll = ConfService::getCoreConf("CROSSUSERS_ALLGROUPS_DISPLAY", "conf");
     if ($searchAll || $displayAll) {
         $baseGroup = "/";
     } else {
         $baseGroup = AuthService::filterBaseGroup("/");
     }
     AuthService::setGroupFiltering(false);
     $users = AuthService::listUsers($baseGroup);
     $minisites = $this->listSharedFiles("minisites");
     foreach ($repos as $repoIndex => $repoObject) {
         if ($repoObject->getAccessType() == "ajxp_conf") {
             continue;
         }
         if (!$repoObject->hasOwner() || $repoObject->getOwner() != $loggedUser->getId()) {
             continue;
         }
         if (is_numeric($repoIndex)) {
             $repoIndex = "" . $repoIndex;
         }
         $name = (isset($minisites[$repoIndex]) ? "[Minisite] " : "") . AJXP_Utils::xmlEntities(SystemTextEncoding::toUTF8($repoObject->getDisplay()));
         $repoArray[$name] = $repoIndex;
     }
     // Sort the list now by name
     ksort($repoArray);
     foreach ($repoArray as $name => $repoIndex) {
         $repoObject =& $repos[$repoIndex];
         $repoAccesses = array();
         foreach ($users as $userId => $userObject) {
             if ($userObject->getId() == $loggedUser->getId()) {
                 continue;
             }
             $label = $userObject->personalRole->filterParameterValue("core.conf", "USER_DISPLAY_NAME", AJXP_REPO_SCOPE_ALL, $userId);
             if (empty($label)) {
                 $label = $userId;
             }
             $acl = $userObject->mergedRole->getAcl($repoObject->getId());
             if (!empty($acl)) {
                 $repoAccesses[] = $label . " (" . $acl . ")";
             }
         }
         $parent = $repoObject->getParentId();
         $parentRepo =& $repos[$parent];
         $parentLabel = $this->metaIcon("folder-open") . $parentRepo->getDisplay();
         $repoPath = $repoObject->getOption("PATH");
         $parentPath = $parentRepo->getOption("PATH");
         $parentLabel .= " (" . str_replace($parentPath, "", $repoPath) . ")";
         $metaData = array("repository_id" => $repoIndex, "icon" => "document_open_remote.png", "openicon" => "document_open_remote.png", "parentname" => "/repositories", "parent_label" => $parentLabel, "repo_accesses" => count($repoAccesses) ? $this->metaIcon("share-sign") . implode(", ", $repoAccesses) : "", "ajxp_mime" => "shared_repository");
         AJXP_XMLWriter::renderNode("/repositories/{$repoIndex}", $name, true, $metaData);
     }
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:58,代码来源:class.UserDashboardDriver.php


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