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


PHP ConfService::getRepository方法代码示例

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


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

示例1: filterActionsRegistry

 private static function filterActionsRegistry(&$registry)
 {
     if (!AuthService::usersEnabled()) {
         return false;
     }
     $loggedUser = AuthService::getLoggedUser();
     if ($loggedUser == null) {
         return false;
     }
     $crtRepo = ConfService::getRepository();
     $crtRepoId = "ajxp.all";
     if ($crtRepo != null && is_a($crtRepo, "Repository")) {
         $crtRepoId = $crtRepo->getId();
     }
     $actionRights = $loggedUser->getSpecificActionsRights($crtRepoId);
     $changes = false;
     $xPath = new DOMXPath($registry);
     foreach ($actionRights as $actionName => $enabled) {
         if ($enabled !== false) {
             continue;
         }
         $actions = $xPath->query("actions/action[@name='{$actionName}']");
         if (!$actions->length) {
             continue;
         }
         $action = $actions->item(0);
         $action->parentNode->removeChild($action);
         $changes = true;
     }
     return $changes;
 }
开发者ID:BackupTheBerlios,项目名称:ascore,代码行数:31,代码来源:class.AJXP_Controller.php

示例2: applyAction

 public function applyAction($actionName, $httpVars, $fileVars)
 {
     $messages = ConfService::getMessages();
     if ($actionName == "index") {
         $repository = ConfService::getRepository();
         $repositoryId = $repository->getId();
         $userSelection = new UserSelection($repository, $httpVars);
         if ($userSelection->isEmpty()) {
             $userSelection->addFile("/");
         }
         $nodes = $userSelection->buildNodes($repository->driverInstance);
         if (isset($httpVars["verbose"]) && $httpVars["verbose"] == "true") {
             $this->verboseIndexation = true;
         }
         if (ConfService::backgroundActionsSupported() && !ConfService::currentContextIsCommandLine()) {
             AJXP_Controller::applyActionInBackground($repositoryId, "index", $httpVars);
             AJXP_XMLWriter::header();
             AJXP_XMLWriter::triggerBgAction("check_index_status", array("repository_id" => $repositoryId), sprintf($messages["core.index.8"], $nodes[0]->getPath()), true, 2);
             if (!isset($httpVars["inner_apply"])) {
                 AJXP_XMLWriter::close();
             }
             return null;
         }
         // GIVE BACK THE HAND TO USER
         session_write_close();
         foreach ($nodes as $node) {
             $dir = $node->getPath() == "/" || is_dir($node->getUrl());
             // SIMPLE FILE
             if (!$dir) {
                 try {
                     $this->logDebug("Indexing - node.index " . $node->getUrl());
                     AJXP_Controller::applyHook("node.index", array($node));
                 } catch (Exception $e) {
                     $this->logDebug("Error Indexing Node " . $node->getUrl() . " (" . $e->getMessage() . ")");
                 }
             } else {
                 try {
                     $this->recursiveIndexation($node);
                 } catch (Exception $e) {
                     $this->logDebug("Indexation of " . $node->getUrl() . " interrupted by error: (" . $e->getMessage() . ")");
                 }
             }
         }
     } else {
         if ($actionName == "check_index_status") {
             $repoId = $httpVars["repository_id"];
             list($status, $message) = $this->getIndexStatus(ConfService::getRepositoryById($repoId), AuthService::getLoggedUser());
             if (!empty($status)) {
                 AJXP_XMLWriter::header();
                 AJXP_XMLWriter::triggerBgAction("check_index_status", array("repository_id" => $repoId), $message, true, 3);
                 AJXP_XMLWriter::close();
             } else {
                 AJXP_XMLWriter::header();
                 AJXP_XMLWriter::triggerBgAction("info_message", array(), $messages["core.index.5"], true, 5);
                 AJXP_XMLWriter::close();
             }
         }
     }
     return null;
 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:60,代码来源:class.CoreIndexer.php

示例3: init

 function init($options)
 {
     parent::init($options);
     $pServ = AJXP_PluginsService::getInstance();
     $aPlugs = $pServ->getActivePlugins();
     $accessPlugs = $pServ->getPluginsByType("access");
     $this->repository = ConfService::getRepository();
     foreach ($accessPlugs as $pId => $plug) {
         if (array_key_exists("access." . $pId, $aPlugs) && $aPlugs["access." . $pId] === true) {
             $this->accessDriver = $plug;
             if (!isset($this->accessDriver->repository)) {
                 $this->accessDriver->init($this->repository);
                 $this->accessDriver->initRepository();
                 $wrapperData = $this->accessDriver->detectStreamWrapper(true);
             } else {
                 $wrapperData = $this->accessDriver->detectStreamWrapper(false);
             }
             $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
         }
     }
     $this->metaStore = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore");
     if ($this->metaStore !== false) {
         $this->metaStore->initMeta($this->accessDriver);
     }
 }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:25,代码来源:class.ShareCenter.php

示例4: postProcess

 public function postProcess($action, $httpVars, $postProcessData)
 {
     if (self::$skipDecoding) {
     }
     if (!isset($httpVars["partitionRealName"])) {
         return;
     }
     $repository = ConfService::getRepository();
     if (!$repository->detectStreamWrapper(false)) {
         return false;
     }
     $plugin = AJXP_PluginsService::findPlugin("access", $repository->getAccessType());
     $streamData = $plugin->detectStreamWrapper(true);
     $destStreamURL = $streamData["protocol"] . "://" . $repository->getId() . $httpVars["dir"] . "/";
     $count = intval($httpVars["partitionCount"]);
     $index = intval($httpVars["partitionIndex"]);
     $fileId = $httpVars["fileId"];
     $clientId = $httpVars["clientId"];
     AJXP_Logger::debug("Should now rebuild file!", $httpVars);
     $newDest = fopen($destStreamURL . $httpVars["partitionRealName"], "w");
     for ($i = 0; $i < $count; $i++) {
         $part = fopen($destStreamURL . "{$clientId}.{$fileId}.{$i}", "r");
         while (!feof($part)) {
             fwrite($newDest, fread($part, 4096));
         }
         fclose($part);
         unlink($destStreamURL . "{$clientId}.{$fileId}.{$i}");
     }
     fclose($newDest);
 }
开发者ID:firstcoder55,项目名称:Webkey,代码行数:30,代码来源:class.JumploaderProcessor.php

示例5: unifyChunks

 public function unifyChunks($action, $httpVars, $fileVars)
 {
     $repository = ConfService::getRepository();
     if (!$repository->detectStreamWrapper(false)) {
         return false;
     }
     $plugin = AJXP_PluginsService::findPlugin("access", $repository->getAccessType());
     $streamData = $plugin->detectStreamWrapper(true);
     $dir = AJXP_Utils::decodeSecureMagic($httpVars["dir"]);
     $destStreamURL = $streamData["protocol"] . "://" . $repository->getId() . $dir . "/";
     $filename = AJXP_Utils::decodeSecureMagic($httpVars["file_name"]);
     $chunks = array();
     $index = 0;
     while (isset($httpVars["chunk_" . $index])) {
         $chunks[] = AJXP_Utils::decodeSecureMagic($httpVars["chunk_" . $index]);
         $index++;
     }
     $newDest = fopen($destStreamURL . $filename, "w");
     for ($i = 0; $i < count($chunks); $i++) {
         $part = fopen($destStreamURL . $chunks[$i], "r");
         while (!feof($part)) {
             fwrite($newDest, fread($part, 4096));
         }
         fclose($part);
         unlink($destStreamURL . $chunks[$i]);
     }
     fclose($newDest);
 }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:28,代码来源:class.SimpleUploadProcessor.php

示例6: switchAction

 public function switchAction($action, $httpVars, $filesVars)
 {
     if (!isset($this->actions[$action])) {
         return false;
     }
     $repository = ConfService::getRepository();
     if (!$repository->detectStreamWrapper(true)) {
         return false;
     }
     if (!isset($this->pluginConf)) {
         $this->pluginConf = array("GENERATE_THUMBNAIL" => false);
     }
     $streamData = $repository->streamData;
     $this->streamData = $streamData;
     $destStreamURL = $streamData["protocol"] . "://" . $repository->getId();
     if ($action == "preview_data_proxy") {
         $file = AJXP_Utils::decodeSecureMagic($httpVars["file"]);
         if (!file_exists($destStreamURL . $file)) {
             header("Content-Type: " . AJXP_Utils::getImageMimeType(basename($file)) . "; name=\"" . basename($file) . "\"");
             header("Content-Length: 0");
             return;
         }
         if (isset($httpVars["get_thumb"]) && $this->getFilteredOption("GENERATE_THUMBNAIL", $repository->getId())) {
             $dimension = 200;
             if (isset($httpVars["dimension"]) && is_numeric($httpVars["dimension"])) {
                 $dimension = $httpVars["dimension"];
             }
             $this->currentDimension = $dimension;
             $cacheItem = AJXP_Cache::getItem("diaporama_" . $dimension, $destStreamURL . $file, array($this, "generateThumbnail"));
             $data = $cacheItem->getData();
             $cId = $cacheItem->getId();
             header("Content-Type: " . AJXP_Utils::getImageMimeType(basename($cId)) . "; name=\"" . basename($cId) . "\"");
             header("Content-Length: " . strlen($data));
             header('Cache-Control: public');
             header("Pragma:");
             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");
             print $data;
         } else {
             //$filesize = filesize($destStreamURL.$file);
             $node = new AJXP_Node($destStreamURL . $file);
             $fp = fopen($destStreamURL . $file, "r");
             $stat = fstat($fp);
             $filesize = $stat["size"];
             header("Content-Type: " . AJXP_Utils::getImageMimeType(basename($file)) . "; name=\"" . basename($file) . "\"");
             header("Content-Length: " . $filesize);
             header('Cache-Control: public');
             header("Pragma:");
             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");
             $class = $streamData["classname"];
             $stream = fopen("php://output", "a");
             call_user_func(array($streamData["classname"], "copyFileInStream"), $destStreamURL . $file, $stream);
             fflush($stream);
             fclose($stream);
             AJXP_Controller::applyHook("node.read", array($node));
         }
     }
 }
开发者ID:biggtfish,项目名称:cms,代码行数:59,代码来源:class.ImagePreviewer.php

示例7: switchAction

 public function switchAction($action, $httpVars, $filesVars)
 {
     if (!isset($this->actions[$action])) {
         return false;
     }
     $repository = ConfService::getRepository();
     if (!$repository->detectStreamWrapper(true)) {
         return false;
     }
     $streamData = $repository->streamData;
     $destStreamURL = $streamData["protocol"] . "://" . $repository->getId();
     if ($action == "post_to_server") {
         $file = base64_decode(AJXP_Utils::decodeSecureMagic($httpVars["file"]));
         $target = base64_decode($httpVars["parent_url"]) . "/plugins/editor.pixlr";
         $tmp = call_user_func(array($streamData["classname"], "getRealFSReference"), $destStreamURL . $file);
         $fData = array("tmp_name" => $tmp, "name" => urlencode(basename($file)), "type" => "image/jpg");
         $httpClient = new HttpClient("pixlr.com");
         //$httpClient->setDebug(true);
         $postData = array();
         $httpClient->setHandleRedirects(false);
         $params = array("referrer" => "AjaXplorer", "method" => "get", "loc" => ConfService::getLanguage(), "target" => $target . "/fake_save_pixlr.php", "exit" => $target . "/fake_close_pixlr.php", "title" => urlencode(basename($file)), "locktarget" => "false", "locktitle" => "true", "locktype" => "source");
         $httpClient->postFile("/editor/", $params, "image", $fData);
         $loc = $httpClient->getHeader("location");
         header("Location:{$loc}");
     } else {
         if ($action == "retrieve_pixlr_image") {
             $file = AJXP_Utils::decodeSecureMagic($httpVars["original_file"]);
             $url = $httpVars["new_url"];
             $urlParts = parse_url($url);
             $query = $urlParts["query"];
             $params = array();
             $parameters = parse_str($query, $params);
             $image = $params['image'];
             /*
             $type = $params['type'];
             $state = $params['state'];
             $filename = $params['title'];		
             */
             if (strpos($image, "pixlr.com") == 0) {
                 throw new AJXP_Exception("Invalid Referrer");
             }
             $headers = get_headers($image, 1);
             $content_type = explode("/", $headers['Content-Type']);
             if ($content_type[0] != "image") {
                 throw new AJXP_Exception("File Type");
             }
             $orig = fopen($image, "r");
             $target = fopen($destStreamURL . $file, "w");
             while (!feof($orig)) {
                 fwrite($target, fread($orig, 4096));
             }
             fclose($orig);
             fclose($target);
             header("Content-Type:text/plain");
             print $mess[115];
         }
     }
     return;
 }
开发者ID:firstcoder55,项目名称:Webkey,代码行数:59,代码来源:class.PixlrEditor.php

示例8: switchActions

 public function switchActions($actionName, $httpVars, $fileVars)
 {
     //$urlBase = $this->accessDriver
     $repository = ConfService::getRepository();
     if (!$repository->detectStreamWrapper(true)) {
         return false;
     }
     if (!isset($this->pluginConf)) {
         $this->pluginConf = array("GENERATE_THUMBNAIL" => false);
     }
     $streamData = $repository->streamData;
     $this->streamData = $streamData;
     $destStreamURL = $streamData["protocol"] . "://" . $repository->getId();
     switch ($actionName) {
         case "filehasher_signature":
             $file = AJXP_Utils::decodeSecureMagic($httpVars["file"]);
             if (!file_exists($destStreamURL . $file)) {
                 break;
             }
             $cacheItem = AJXP_Cache::getItem("signatures", $destStreamURL . $file, array($this, "generateSignature"));
             $data = $cacheItem->getData();
             header("Content-Type:application/octet-stream");
             header("Content-Length", strlen($data));
             echo $data;
             break;
         case "filehasher_delta":
         case "filehasher_patch":
             // HANDLE UPLOAD DATA
             if (!isset($fileVars) && !is_array($fileVars["userfile_0"])) {
                 throw new Exception("These action should find uploaded data");
             }
             $uploadedData = tempnam(AJXP_Utils::getAjxpTmpDir(), $actionName . "-sig");
             move_uploaded_file($fileVars["userfile_0"]["tmp_name"], $uploadedData);
             $fileUrl = $destStreamURL . AJXP_Utils::decodeSecureMagic($httpVars["file"]);
             $file = call_user_func(array($this->streamData["classname"], "getRealFSReference"), $fileUrl, true);
             if ($actionName == "filehasher_delta") {
                 $signatureFile = $uploadedData;
                 $deltaFile = tempnam(AJXP_Utils::getAjxpTmpDir(), $actionName . "-delta");
                 rsync_generate_delta($signatureFile, $file, $deltaFile);
                 header("Content-Type:application/octet-stream");
                 header("Content-Length:" . filesize($deltaFile));
                 readfile($deltaFile);
                 unlink($signatureFile);
                 unlink($deltaFile);
             } else {
                 $patched = $file . ".rdiff_patched";
                 $deltaFile = $uploadedData;
                 rsync_patch_file($file, $deltaFile, $patched);
                 rename($patched, $file);
                 header("Content-Type:text/plain");
                 unlink($deltaFile);
                 echo md5_file($file);
             }
             break;
     }
 }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:56,代码来源:class.FileHasher.php

示例9: switchAction

 public function switchAction($action, $httpVars, $postProcessData)
 {
     if (!isset($this->actions[$action])) {
         return false;
     }
     $repository = ConfService::getRepository();
     if (!$repository->detectStreamWrapper(false)) {
         return false;
     }
     $plugin = AJXP_PluginsService::findPlugin("access", $repository->getAccessType());
     $streamData = $plugin->detectStreamWrapper(true);
     $destStreamURL = $streamData["protocol"] . "://" . $repository->getId() . "/";
     if ($action == "audio_proxy") {
         $file = AJXP_Utils::decodeSecureMagic(base64_decode($httpVars["file"]));
         $cType = "audio/" . array_pop(explode(".", $file));
         $localName = basename($file);
         header("Content-Type: " . $cType . "; name=\"" . $localName . "\"");
         header("Content-Length: " . filesize($destStreamURL . $file));
         $stream = fopen("php://output", "a");
         call_user_func(array($streamData["classname"], "copyFileInStream"), $destStreamURL . $file, $stream);
         fflush($stream);
         fclose($stream);
         $node = new AJXP_Node($destStreamURL . $file);
         AJXP_Controller::applyHook("node.read", array($node));
         //exit(1);
     } else {
         if ($action == "ls") {
             if (!isset($httpVars["playlist"])) {
                 // This should not happen anyway, because of the applyCondition.
                 AJXP_Controller::passProcessDataThrough($postProcessData);
                 return;
             }
             // We transform the XML into XSPF
             $xmlString = $postProcessData["ob_output"];
             $xmlDoc = new DOMDocument();
             $xmlDoc->loadXML($xmlString);
             $xElement = $xmlDoc->documentElement;
             header("Content-Type:application/xspf+xml;charset=UTF-8");
             print '<?xml version="1.0" encoding="UTF-8"?>';
             print '<playlist version="1" xmlns="http://xspf.org/ns/0/">';
             print "<trackList>";
             foreach ($xElement->childNodes as $child) {
                 $isFile = $child->getAttribute("is_file") == "true";
                 $label = $child->getAttribute("text");
                 $ar = explode(".", $label);
                 $ext = strtolower(end($ar));
                 if (!$isFile || $ext != "mp3") {
                     continue;
                 }
                 print "<track><location>" . AJXP_SERVER_ACCESS . "?secure_token=" . AuthService::getSecureToken() . "&get_action=audio_proxy&file=" . base64_encode($child->getAttribute("filename")) . "</location><title>" . $label . "</title></track>";
             }
             print "</trackList>";
             AJXP_XMLWriter::close("playlist");
         }
     }
 }
开发者ID:biggtfish,项目名称:cms,代码行数:56,代码来源:class.AudioPreviewer.php

示例10: initMeta

 public function initMeta($accessDriver)
 {
     require_once "VersionControl/Git.php";
     $repo = ConfService::getRepository();
     $this->repoBase = $repo->getOption("PATH");
     if (!is_dir($this->repoBase . DIRECTORY_SEPARATOR . ".git")) {
         $git = new VersionControl_Git($this->repoBase);
         $git->initRepository();
     }
 }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:10,代码来源:class.GitManager.php

示例11: filterRegistryFromRole

 /**
  * Check the current user "specificActionsRights" and filter the full registry actions with these.
  * @static
  * @param DOMDocument $registry
  * @return bool
  */
 public static function filterRegistryFromRole(&$registry)
 {
     if (!AuthService::usersEnabled()) {
         return false;
     }
     $loggedUser = AuthService::getLoggedUser();
     if ($loggedUser == null) {
         return false;
     }
     $crtRepo = ConfService::getRepository();
     $crtRepoId = AJXP_REPO_SCOPE_ALL;
     // "ajxp.all";
     if ($crtRepo != null && is_a($crtRepo, "Repository")) {
         $crtRepoId = $crtRepo->getId();
     }
     $actionRights = $loggedUser->mergedRole->listActionsStatesFor($crtRepo);
     $changes = false;
     $xPath = new DOMXPath($registry);
     foreach ($actionRights as $pluginName => $actions) {
         foreach ($actions as $actionName => $enabled) {
             if ($enabled !== false) {
                 continue;
             }
             $actions = $xPath->query("actions/action[@name='{$actionName}']");
             if (!$actions->length) {
                 continue;
             }
             $action = $actions->item(0);
             $action->parentNode->removeChild($action);
             $changes = true;
         }
     }
     $parameters = $loggedUser->mergedRole->listParameters();
     foreach ($parameters as $scope => $paramsPlugs) {
         if ($scope == AJXP_REPO_SCOPE_ALL || $scope == $crtRepoId || $crtRepo != null && $crtRepo->hasParent() && $scope == AJXP_REPO_SCOPE_SHARED) {
             foreach ($paramsPlugs as $plugId => $params) {
                 foreach ($params as $name => $value) {
                     // Search exposed plugin_configs, replace if necessary.
                     $searchparams = $xPath->query("plugins/*[@id='{$plugId}']/plugin_configs/property[@name='{$name}']");
                     if (!$searchparams->length) {
                         continue;
                     }
                     $param = $searchparams->item(0);
                     $newCdata = $registry->createCDATASection(json_encode($value));
                     $param->removeChild($param->firstChild);
                     $param->appendChild($newCdata);
                 }
             }
         }
     }
     return $changes;
 }
开发者ID:projectesIF,项目名称:Ateneu,代码行数:58,代码来源:class.AJXP_Controller.php

示例12: updateMetaShort

 protected function updateMetaShort($file, $shortUrl)
 {
     $metaStore = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore");
     if ($metaStore !== false) {
         $driver = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("access");
         $metaStore->initMeta($driver);
         $streamData = $driver->detectStreamWrapper(false);
         $baseUrl = $streamData["protocol"] . "://" . ConfService::getRepository()->getId();
         $node = new AJXP_Node($baseUrl . $file);
         $metadata = $metaStore->retrieveMetadata($node, "ajxp_shared", true, AJXP_METADATA_SCOPE_REPOSITORY);
         $metadata["short_form_url"] = $shortUrl;
         $metaStore->setMetadata($node, "ajxp_shared", $metadata, true, AJXP_METADATA_SCOPE_REPOSITORY);
     }
 }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:14,代码来源:class.BitlyShortener.php

示例13: switchActions

 public function switchActions($actionName, $httpVars, $fileVars)
 {
     if ($actionName != "changes" || !isset($httpVars["seq_id"])) {
         return false;
     }
     require_once AJXP_BIN_FOLDER . "/dibi.compact.php";
     dibi::connect($this->sqlDriver);
     HTMLWriter::charsetHeader('application/json', 'UTF-8');
     $res = dibi::query("SELECT\n                [seq] , [ajxp_changes].[repository_identifier] , [ajxp_changes].[node_id] , [type] , [source] ,  [target] , [ajxp_index].[bytesize], [ajxp_index].[md5], [ajxp_index].[mtime], [ajxp_index].[node_path]\n                FROM [ajxp_changes]\n                LEFT JOIN [ajxp_index]\n                    ON [ajxp_changes].[node_id] = [ajxp_index].[node_id]\n                WHERE [ajxp_changes].[repository_identifier] = %s AND [seq] > %i\n                ORDER BY [ajxp_changes].[node_id], [seq] ASC", $this->computeIdentifier(ConfService::getRepository()), AJXP_Utils::sanitize($httpVars["seq_id"], AJXP_SANITIZE_ALPHANUM));
     echo '{"changes":[';
     $previousNodeId = -1;
     $previousRow = null;
     $order = array("path" => 0, "content" => 1, "create" => 2, "delete" => 3);
     $relocateAttrs = array("bytesize", "md5", "mtime", "node_path", "repository_identifier");
     foreach ($res as $row) {
         $row->node = array();
         foreach ($relocateAttrs as $att) {
             $row->node[$att] = $row->{$att};
             unset($row->{$att});
         }
         if ($row->node_id == $previousNodeId) {
             $previousRow->target = $row->target;
             $previousRow->seq = $row->seq;
             if ($order[$row->type] > $order[$previousRow->type]) {
                 $previousRow->type = $row->type;
             }
         } else {
             if (isset($previousRow) && ($previousRow->source != $previousRow->target || $previousRow->type == "content")) {
                 echo json_encode($previousRow) . ",";
             }
             $previousRow = $row;
             $previousNodeId = $row->node_id;
         }
         $lastSeq = $row->seq;
         flush();
     }
     if (isset($previousRow) && ($previousRow->source != $previousRow->target || $previousRow->type == "content")) {
         echo json_encode($previousRow);
     }
     if (isset($lastSeq)) {
         echo '], "last_seq":' . $lastSeq . '}';
     } else {
         $lastSeq = dibi::query("SELECT MAX([seq]) FROM [ajxp_changes]")->fetchSingle();
         if (empty($lastSeq)) {
             $lastSeq = 1;
         }
         echo '], "last_seq":' . $lastSeq . '}';
     }
 }
开发者ID:biggtfish,项目名称:cms,代码行数:49,代码来源:class.ChangesTracker.php

示例14: switchAction

 public function switchAction($action, $httpVars, $filesVars)
 {
     if (!isset($this->actions[$action])) {
         return false;
     }
     $repository = ConfService::getRepository();
     if (!$repository->detectStreamWrapper(true)) {
         return false;
     }
     if (!isset($this->pluginConf)) {
         $this->pluginConf = array("GENERATE_THUMBNAIL" => false);
     }
     $streamData = $repository->streamData;
     $destStreamURL = $streamData["protocol"] . "://" . $repository->getId();
     if ($action == "preview_data_proxy") {
         $file = AJXP_Utils::decodeSecureMagic($httpVars["file"]);
         if (isset($httpVars["get_thumb"]) && $this->pluginConf["GENERATE_THUMBNAIL"]) {
             require_once INSTALL_PATH . "/plugins/editor.diaporama/PThumb.lib.php";
             $pThumb = new PThumb($this->pluginConf["THUMBNAIL_QUALITY"]);
             if (!$pThumb->isError()) {
                 $pThumb->remote_wrapper = $streamData["classname"];
                 $pThumb->use_cache = $this->pluginConf["USE_THUMBNAIL_CACHE"];
                 $pThumb->cache_dir = $this->pluginConf["THUMBNAIL_CACHE_DIR"];
                 $pThumb->fit_thumbnail($destStreamURL . $file, 200);
                 if ($pThumb->isError()) {
                     print_r($pThumb->error_array);
                     AJXP_Logger::logAction("error", $pThumb->error_array);
                 }
                 //exit(0);
             } else {
                 print_r($pThumb->error_array);
                 AJXP_Logger::logAction("error", $pThumb->error_array);
             }
         } else {
             $filesize = filesize($destStreamURL . $file);
             $fp = fopen($destStreamURL . $file, "r");
             header("Content-Type: " . AJXP_Utils::getImageMimeType(basename($file)) . "; name=\"" . basename($file) . "\"");
             header("Content-Length: " . $filesize);
             header('Cache-Control: public');
             $class = $streamData["classname"];
             $stream = fopen("php://output", "a");
             call_user_func(array($streamData["classname"], "copyFileInStream"), $destStreamURL . $file, $stream);
             fflush($stream);
             fclose($stream);
             //exit(1);
         }
     }
 }
开发者ID:firstcoder55,项目名称:Webkey,代码行数:48,代码来源:class.ImagePreviewer.php

示例15: __construct

 public function __construct($repository)
 {
     $repositoryId = $repository->isWriteable() ? $repository->getUniqueId() : $repository->getId();
     ConfService::switchRootDir($repositoryId);
     $this->repository = ConfService::getRepository();
     $this->options = new ezcWebdavFileBackendOptions();
     $this->options['noLock'] = false;
     $this->options['waitForLock'] = 200000;
     $this->options['lockTimeout'] = 2;
     $this->options['lockFileName'] = '.ezc_lock';
     $this->options['propertyStoragePath'] = '.ezc';
     $this->options['directoryMode'] = 0755;
     $this->options['fileMode'] = 0644;
     $this->options['useMimeExts'] = false;
     $this->options['hideDotFiles'] = true;
 }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:16,代码来源:class.AJXP_WebdavBackend.php


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