• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AJXP_PluginsService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: init

 public function init($options)
 {
     parent::init($options);
     // Load all enabled frontend plugins
     $fronts = AJXP_PluginsService::getInstance()->getPluginsByType("authfront");
     usort($fronts, array($this, "frontendsSort"));
     foreach ($fronts as $front) {
         if ($front->isEnabled()) {
             $configs = $front->getConfigs();
             $protocol = $configs["PROTOCOL_TYPE"];
             if ($protocol == "session_only" && !AuthService::$useSession) {
                 continue;
             }
             if ($protocol == "no_session" && AuthService::$useSession) {
                 continue;
             }
             AJXP_PluginsService::setPluginActive($front->getType(), $front->getName(), true);
         }
     }
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:20,代码来源:class.FrontendsLoader.php


示例17: orbitExtensionActive

 private function orbitExtensionActive()
 {
     $confs = ConfService::getConfStorageImpl()->loadPluginConfig("gui", "ajax");
     if (!isset($confs) || !isset($confs["GUI_THEME"])) {
         $confs["GUI_THEME"] = "orbit";
     }
     if ($confs["GUI_THEME"] == "orbit") {
         $pServ = AJXP_PluginsService::getInstance();
         $activePlugs = $pServ->getActivePlugins();
         $streamWrappers = $pServ->getStreamWrapperPlugins();
         $streamActive = false;
         foreach ($streamWrappers as $sW) {
             if (array_key_exists($sW, $activePlugs) && $activePlugs[$sW] === true) {
                 $streamActive = true;
                 break;
             }
         }
         return $streamActive;
     }
     return false;
 }
开发者ID:thermalpaste,项目名称:pydio-core,代码行数:21,代码来源:class.MobileGuiPlugin.php


示例18: preProcess

 public function preProcess($action, &$httpVars, &$fileVars)
 {
     $repository = ConfService::getRepository();
     $skipDecoding = false;
     if ($repository->detectStreamWrapper(false)) {
         $plugin = AJXP_PluginsService::findPlugin("access", $repository->getAccessType());
         $streamData = $plugin->detectStreamWrapper(true);
         if ($streamData["protocol"] == "ajxp.ftp" || $streamData["protocol"] == "ajxp.remotefs") {
             AJXP_Logger::debug("Skip decoding");
             $skipDecoding = true;
         }
     }
     if (isset($fileVars["Filedata"])) {
         self::$active = true;
         AJXP_Logger::debug("Dir before base64", $httpVars);
         $httpVars["dir"] = base64_decode(urldecode($httpVars["dir"]));
         if (!$skipDecoding) {
             $fileVars["Filedata"]["name"] = SystemTextEncoding::fromUTF8($fileVars["Filedata"]["name"]);
         }
         $fileVars["userfile_0"] = $fileVars["Filedata"];
         unset($fileVars["Filedata"]);
         AJXP_Logger::debug("Setting FlexProc active");
     }
 }
开发者ID:firstcoder55,项目名称:Webkey,代码行数:24,代码来源:class.FlexUploadProcessor.php


示例19: testConnexions

 /**
  * Helpers to test SQL connection and send a test email.
  * @param $action
  * @param $httpVars
  * @param $fileVars
  * @throws Exception
  */
 public function testConnexions($action, $httpVars, $fileVars)
 {
     $data = array();
     AJXP_Utils::parseStandardFormParameters($httpVars, $data, null, "DRIVER_OPTION_");
     if ($action == "boot_test_sql_connexion") {
         $p = AJXP_Utils::cleanDibiDriverParameters($data["db_type"]);
         if ($p["driver"] == "sqlite3") {
             $dbFile = AJXP_VarsFilter::filter($p["database"]);
             if (!file_exists(dirname($dbFile))) {
                 mkdir(dirname($dbFile), 0755, true);
             }
         }
         // Should throw an exception if there was a problem.
         dibi::connect($p);
         dibi::disconnect();
         echo 'SUCCESS:Connexion established!';
     } else {
         if ($action == "boot_test_mailer") {
             $mailerPlug = AJXP_PluginsService::findPluginById("mailer.phpmailer-lite");
             $mailerPlug->loadConfigs(array("MAILER" => $data["MAILER_ENABLE"]["MAILER_SYSTEM"]));
             $mailerPlug->sendMail(array("adress" => $data["MAILER_ENABLE"]["MAILER_ADMIN"]), "Pydio Test Mail", "Body of the test", array("adress" => $data["MAILER_ENABLE"]["MAILER_ADMIN"]));
             echo 'SUCCESS:Mail sent to the admin adress, please check it is in your inbox!';
         }
     }
 }
开发者ID:rbrdevs,项目名称:pydio-core,代码行数:32,代码来源:class.BootConfLoader.php


示例20: postProcess

 public function postProcess($action, $httpVars, $postProcessData)
 {
     if (isset($httpVars["simple_uploader"]) || isset($httpVars["xhr_uploader"])) {
         return;
     }
     /* If set resumeFileId and resumePartitionIndex, cross-session resume is requested. */
     if (isset($httpVars["resumeFileId"]) && isset($httpVars["resumePartitionIndex"])) {
         header("HTTP/1.1 200 OK");
         print "fileId: " . $httpVars["resumeFileId"] . "\n";
         print "partitionIndex: " . $httpVars["resumePartitionIndex"];
         return;
     }
     /*if (self::$skipDecoding) {
     
             }*/
     if (isset($postProcessData["processor_result"]["ERROR"])) {
         if (isset($httpVars["lastPartition"]) && isset($httpVars["partitionCount"])) {
             /* we get the stream url (where all the partitions have been uploaded so far) */
             $repository = ConfService::getRepository();
             $dir = AJXP_Utils::decodeSecureMagic($httpVars["dir"]);
             $plugin = AJXP_PluginsService::findPlugin("access", $repository->getAccessType());
             $streamData = $plugin->detectStreamWrapper(true);
             $destStreamURL = $streamData["protocol"] . "://" . $repository->getId() . $dir . "/";
             if ($httpVars["partitionCount"] > 1) {
                 /* we fetch the information that help us to construct the temp files name */
                 $fileId = $httpVars["fileId"];
                 $fileHash = md5($httpVars["fileName"]);
                 /* deletion of all the partitions that have been uploaded */
                 for ($i = 0; $i < $httpVars["partitionCount"]; $i++) {
                     if (file_exists($destStreamURL . "{$fileHash}.{$fileId}.{$i}")) {
                         unlink($destStreamURL . "{$fileHash}.{$fileId}.{$i}");
                     }
                 }
             } else {
                 $fileName = $httpVars["fileName"];
                 unlink($destStreamURL . $fileName);
             }
         }
         echo "Error: " . $postProcessData["processor_result"]["ERROR"]["MESSAGE"];
         return;
     }
     if (!isset($httpVars["partitionRealName"]) && !isset($httpVars["lastPartition"])) {
         return;
     }
     $repository = ConfService::getRepository();
     $driver = ConfService::loadDriverForRepository($repository);
     if (!$repository->detectStreamWrapper(false)) {
         return false;
     }
     if ($httpVars["lastPartition"]) {
         $plugin = AJXP_PluginsService::findPlugin("access", $repository->getAccessType());
         $streamData = $plugin->detectStreamWrapper(true);
         $dir = AJXP_Utils::decodeSecureMagic($httpVars["dir"]);
         $destStreamURL = $streamData["protocol"] . "://" . $repository->getId() . $dir . "/";
         /* we check if the current file has a relative path (aka we want to upload an entire directory) */
         $this->logDebug("Now dispatching relativePath dest:", $httpVars["relativePath"]);
         $subs = explode("/", $httpVars["relativePath"]);
         $userfile_name = array_pop($subs);
         $folderForbidden = false;
         $all_in_place = true;
         $partitions_length = 0;
         $fileId = $httpVars["fileId"];
         $fileHash = md5($userfile_name);
         $partitionCount = $httpVars["partitionCount"];
         $fileLength = $_POST["fileLength"];
         /*
          *
          * Now, we supposed that access driver has already saved uploaded file in to
          * folderServer with file name is md5 relativePath value.
          * We try to copy this file to right location in recovery his name.
          *
          */
         $userfile_name = md5($httpVars["relativePath"]);
         if (self::$remote) {
             $partitions = array();
             $newPartitions = array();
             $index_first_partition = -1;
             $i = 0;
             do {
                 $currentFileName = $driver->getFileNameToCopy();
                 $partitions[] = $driver->getNextFileToCopy();
                 if ($index_first_partition < 0 && strstr($currentFileName, $fileHash) != false) {
                     $index_first_partition = $i;
                 } else {
                     if ($index_first_partition < 0) {
                         $newPartitions[] = array_pop($partitions);
                     }
                 }
             } while ($driver->hasFilesToCopy());
         }
         /* if partitionned */
         if ($partitionCount > 1) {
             if (self::$remote) {
                 for ($i = 0; $all_in_place && $i < $partitionCount; $i++) {
                     $partition_file = "{$fileHash}.{$fileId}.{$i}";
                     if (strstr($partitions[$i]["name"], $partition_file) != false) {
                         $partitions_length += filesize($partitions[$i]["tmp_name"]);
                     } else {
                         $all_in_place = false;
                     }
//.........这里部分代码省略.........
开发者ID:projectesIF,项目名称:Ateneu,代码行数:101,代码来源:class.JumploaderProcessor.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AJXP_Utils类代码示例发布时间:2022-05-23
下一篇:
PHP AJXP_Plugin类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap