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


PHP AJXP_PluginsService类代码示例

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


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

示例1: 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

示例2: init

 public function init($options)
 {
     //parent::init($options);
     $this->options = $options;
     $this->driversDef = $this->getOption("DRIVERS");
     $this->masterSlaveMode = $this->getOption("MODE") == "MASTER_SLAVE";
     $this->masterName = $this->getOption("MASTER_DRIVER");
     $this->baseName = $this->getOption("USER_BASE_DRIVER");
     foreach ($this->driversDef as $def) {
         $name = $def["NAME"];
         $options = $def["OPTIONS"];
         $options["TRANSMIT_CLEAR_PASS"] = $this->options["TRANSMIT_CLEAR_PASS"];
         $options["LOGIN_REDIRECT"] = $this->options["LOGIN_REDIRECT"];
         $instance = AJXP_PluginsService::findPlugin("auth", $name);
         if (!is_object($instance)) {
             throw new Exception("Cannot find plugin {$name} for type 'auth'");
         }
         $instance->init($options);
         if ($name != $this->getOption("MASTER_DRIVER")) {
             $this->slaveName = $name;
         }
         $this->drivers[$name] = $instance;
     }
     if (!$this->masterSlaveMode) {
         // Enable Multiple choice login screen
         $multi = AJXP_PluginsService::getInstance()->findPluginById("authfront.multi");
         $multi->enabled = true;
         $multi->options = $this->options;
     }
     // THE "LOAD REGISTRY CONTRIBUTIONS" METHOD
     // WILL BE CALLED LATER, TO BE SURE THAT THE
     // SESSION IS ALREADY STARTED.
 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:33,代码来源:class.multiAuthDriver.php

示例3: setUp

 protected function setUp()
 {
     $pServ = AJXP_PluginsService::getInstance();
     ConfService::init();
     $confPlugin = ConfService::getInstance()->confPluginSoftLoad($pServ);
     $pServ->loadPluginsRegistry(AJXP_INSTALL_PATH . "/plugins", $confPlugin);
     ConfService::start();
 }
开发者ID:thermalpaste,项目名称:pydio-core,代码行数:8,代码来源:CoreStorages.php

示例4: 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

示例5: init

 public function init($options)
 {
     parent::init($options);
     if (!isset($this->options["FTP_LOGIN_SCREEN"]) || $this->options["FTP_LOGIN_SCREEN"] != "TRUE" || $this->options["FTP_LOGIN_SCREEN"] === false) {
         return;
     }
     // ENABLE WEBFTP LOGIN SCREEN
     $this->logDebug(__FUNCTION__, "Enabling authfront.webftp");
     AJXP_PluginsService::findPluginById("authfront.webftp")->enabled = true;
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:10,代码来源:class.ftpAuthDriver.php

示例6: initMeta

 public function initMeta($accessDriver)
 {
     parent::initMeta($accessDriver);
     $store = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore");
     if ($store === false) {
         throw new Exception("The 'meta.simple_lock' plugin requires at least one active 'metastore' plugin");
     }
     $this->metaStore = $store;
     $this->metaStore->initMeta($accessDriver);
 }
开发者ID:Nanomani,项目名称:pydio-core,代码行数:10,代码来源:class.FileHasher.php

示例7: getConfImpl

 /**
  * @return AbstractConfDriver
  */
 public function getConfImpl()
 {
     if (!isset(self::$confImpl) || isset($this->pluginConf["UNIQUE_INSTANCE_CONFIG"]["instance_name"]) && self::$confImpl->getId() != $this->pluginConf["UNIQUE_INSTANCE_CONFIG"]["instance_name"]) {
         if (isset($this->pluginConf["UNIQUE_INSTANCE_CONFIG"])) {
             self::$confImpl = ConfService::instanciatePluginFromGlobalParams($this->pluginConf["UNIQUE_INSTANCE_CONFIG"], "AbstractConfDriver");
             AJXP_PluginsService::getInstance()->setPluginUniqueActiveForType("conf", self::$confImpl->getName());
         }
     }
     return self::$confImpl;
 }
开发者ID:thermalpaste,项目名称:pydio-core,代码行数:13,代码来源:class.CoreConfLoader.php

示例8: initMeta

 public function initMeta($accessDriver)
 {
     parent::initMeta($accessDriver);
     $this->notificationCenter = AJXP_PluginsService::findPluginById("core.notifications");
     $store = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore");
     if ($store === false) {
         throw new Exception("The 'meta.watch' plugin requires at least one active 'metastore' plugin");
     }
     $this->metaStore = $store;
     $this->metaStore->initMeta($accessDriver);
 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:11,代码来源:class.MetaWatchRegister.php

示例9: processUserAccessPoint

 public function processUserAccessPoint($action, $httpVars, $fileVars)
 {
     switch ($action) {
         case "user_access_point":
             $uri = explode("/", trim($_SERVER["REQUEST_URI"], "/"));
             array_shift($uri);
             $action = array_shift($uri);
             $this->processSubAction($action, $uri);
             $_SESSION['OVERRIDE_GUI_START_PARAMETERS'] = array("REBASE" => "../../", "USER_GUI_ACTION" => $action);
             AJXP_Controller::findActionAndApply("get_boot_gui", array(), array());
             unset($_SESSION['OVERRIDE_GUI_START_PARAMETERS']);
             break;
         case "reset-password-ask":
             // This is a reset password request, generate a token and store it.
             // Find user by id
             if (AuthService::userExists($httpVars["email"])) {
                 // Send email
                 $userObject = ConfService::getConfStorageImpl()->createUserObject($httpVars["email"]);
                 $email = $userObject->personalRole->filterParameterValue("core.conf", "email", AJXP_REPO_SCOPE_ALL, "");
                 if (!empty($email)) {
                     $uuid = AJXP_Utils::generateRandomString(48);
                     ConfService::getConfStorageImpl()->saveTemporaryKey("password-reset", $uuid, AJXP_Utils::decodeSecureMagic($httpVars["email"]), array());
                     $mailer = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("mailer");
                     if ($mailer !== false) {
                         $mess = ConfService::getMessages();
                         $link = AJXP_Utils::detectServerURL() . "/user/reset-password/" . $uuid;
                         $mailer->sendMail(array($email), $mess["gui.user.1"], $mess["gui.user.7"] . "<a href=\"{$link}\">{$link}</a>");
                     } else {
                         echo 'ERROR: There is no mailer configured, please contact your administrator';
                     }
                 }
             }
             // Prune existing expired tokens
             ConfService::getConfStorageImpl()->pruneTemporaryKeys("password-reset", 20);
             echo "SUCCESS";
             break;
         case "reset-password":
             ConfService::getConfStorageImpl()->pruneTemporaryKeys("password-reset", 20);
             // This is a reset password
             if (isset($httpVars["key"]) && isset($httpVars["user_id"])) {
                 $key = ConfService::getConfStorageImpl()->loadTemporaryKey("password-reset", $httpVars["key"]);
                 if ($key != null && $key["user_id"] == $httpVars["user_id"] && AuthService::userExists($key["user_id"])) {
                     AuthService::updatePassword($key["user_id"], $httpVars["new_pass"]);
                 }
                 ConfService::getConfStorageImpl()->deleteTemporaryKey("password-reset", $httpVars["key"]);
             }
             AuthService::disconnect();
             echo 'SUCCESS';
             break;
         default:
             break;
     }
 }
开发者ID:projectesIF,项目名称:Ateneu,代码行数:53,代码来源:class.UserGuiController.php

示例10: 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

示例11: pack

 /**
  * Static function for packing all js and css into big files
  * Auto detect /js/*_list.txt files and /css/*_list.txt files and pack them.
  */
 function pack()
 {
     // Make sure that the gui.* plugin is loaded
     $plug = AJXP_PluginsService::getInstance()->getPluginsByType("gui");
     $sList = glob(CLIENT_RESOURCES_FOLDER . "/js/*_list.txt");
     foreach ($sList as $list) {
         $scriptName = str_replace("_list.txt", ".js", $list);
         AJXP_JSPacker::concatListAndPack($list, $scriptName, "Normal");
     }
     $sList = glob(AJXP_THEME_FOLDER . "/css/*_list.txt");
     foreach ($sList as $list) {
         $scriptName = str_replace("_list.txt", ".css", $list);
         AJXP_JSPacker::concatListAndPack($list, $scriptName, "None");
     }
 }
开发者ID:crodriguezn,项目名称:administrator-files,代码行数:19,代码来源:class.AJXP_JSPacker.php

示例12: getCacheImpl

 public function getCacheImpl()
 {
     $pluginInstance = null;
     if (!isset(self::$cacheInstance) || isset($this->pluginConf["UNIQUE_INSTANCE_CONFIG"]["instance_name"]) && self::$cacheInstance->getId() != $this->pluginConf["UNIQUE_INSTANCE_CONFIG"]["instance_name"]) {
         if (isset($this->pluginConf["UNIQUE_INSTANCE_CONFIG"])) {
             $pluginInstance = ConfService::instanciatePluginFromGlobalParams($this->pluginConf["UNIQUE_INSTANCE_CONFIG"], "AbstractCacheDriver");
             if ($pluginInstance != false) {
                 AJXP_PluginsService::getInstance()->setPluginUniqueActiveForType("cache", $pluginInstance->getName(), $pluginInstance);
             }
         }
         self::$cacheInstance = $pluginInstance;
         if ($pluginInstance !== null && is_a($pluginInstance, "AbstractCacheDriver") && $pluginInstance->supportsPatternDelete(AJXP_CACHE_SERVICE_NS_NODES)) {
             AJXP_MetaStreamWrapper::appendMetaWrapper("pydio.cache", "CacheStreamLayer");
         }
     }
     return self::$cacheInstance;
 }
开发者ID:Nanomani,项目名称:pydio-core,代码行数:17,代码来源:class.CoreCacheLoader.php

示例13: getChildren

 public function getChildren()
 {
     $this->children = array();
     $u = AuthService::getLoggedUser();
     if ($u != null) {
         $repos = ConfService::getAccessibleRepositories($u);
         // Refilter to make sure the driver is an AjxpWebdavProvider
         foreach ($repos as $repository) {
             $accessType = $repository->getAccessType();
             $driver = AJXP_PluginsService::getInstance()->getPluginByTypeName("access", $accessType);
             if (is_a($driver, "AjxpWrapperProvider") && $repository->getOption("AJXP_WEBDAV_DISABLED") !== true) {
                 $this->children[$repository->getSlug()] = new Sabre\DAV\SimpleCollection($repository->getSlug());
             }
         }
     }
     return $this->children;
 }
开发者ID:rbrdevs,项目名称:pydio-core,代码行数:17,代码来源:class.AJXP_Sabre_RootCollection.php

示例14: switchAction

 public function switchAction($actionName, $httpVars, $fileVars)
 {
     if ($actionName == "search-cart-download") {
         // Pipe SEARCH + DOWNLOAD actions.
         $indexer = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("index");
         if ($indexer == false) {
             return;
         }
         $httpVars["return_selection"] = true;
         unset($httpVars["get_action"]);
         $res = AJXP_Controller::findActionAndApply("search", $httpVars, $fileVars);
         if (isset($res) && is_array($res)) {
             $newHttpVars = array("selection_nodes" => $res, "dir" => "__AJXP_ZIP_FLAT__/", "archive_name" => $httpVars["archive_name"]);
             AJXP_Controller::findActionAndApply("download", $newHttpVars, array());
         }
     }
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:17,代码来源:class.CartManager.php

示例15: updateMetaShort

 protected function updateMetaShort($file, $elementId, $shortUrl)
 {
     $driver = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("access");
     $streamData = $driver->detectStreamWrapper(false);
     $baseUrl = $streamData["protocol"] . "://" . ConfService::getRepository()->getId();
     $node = new AJXP_Node($baseUrl . $file);
     if ($node->hasMetaStore()) {
         $metadata = $node->retrieveMetadata("ajxp_shared", true, AJXP_METADATA_SCOPE_REPOSITORY);
         if ($elementId != -1) {
             if (!is_array($metadata["element"][$elementId])) {
                 $metadata["element"][$elementId] = array();
             }
             $metadata["element"][$elementId]["short_form_url"] = $shortUrl;
         } else {
             $metadata['short_form_url'] = $shortUrl;
         }
         $node->setMetadata("ajxp_shared", $metadata, true, AJXP_METADATA_SCOPE_REPOSITORY);
     }
 }
开发者ID:biggtfish,项目名称:cms,代码行数:19,代码来源:class.BitlyShortener.php


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