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


PHP ConfService::setRepository方法代码示例

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


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

示例1: loadPubliclet

 /** Load a uncyphered publiclet */
 function loadPubliclet($data)
 {
     // create driver from $data
     $className = $data["DRIVER"] . "AccessDriver";
     if ($data["EXPIRE_TIME"] && time() > $data["EXPIRE_TIME"]) {
         // Remove the publiclet, it's done
         if (strstr(PUBLIC_DOWNLOAD_FOLDER, $_SERVER["SCRIPT_FILENAME"]) !== FALSE) {
             unlink($_SERVER["SCRIPT_FILENAME"]);
         }
         echo "Link is expired, sorry.";
         exit;
     }
     // Check password
     if (strlen($data["PASSWORD"])) {
         if ($_POST['password'] != $data["PASSWORD"]) {
             echo "<html><head><link rel='stylesheet' type='text/css' href='allz.css'/></head><body><form action='' method='post'><div class='dialogBox' style='display:block;width:20%;left:40%;'><div class='dialogTitle'><img width='16' height='16' align='top' src='public_url.png'>&nbsp;AjaXplorer Public Download</div><div class='dialogContent'>A password is required for this download :<br><input type='password' name='password' style='width:100%;'><br><div class='dialogButtons'><input width='22' height='22' type='image' name='ok' src='dialog_ok_apply.png' title='Download' class='dialogButton'></div></div></div></form></body></html>";
             exit(1);
         }
     }
     $filePath = INSTALL_PATH . "/plugins/access." . $data["DRIVER"] . "/class." . $className . ".php";
     if (!is_file($filePath)) {
         die("Warning, cannot find driver for conf storage! ({$name}, {$filePath})");
     }
     require_once $filePath;
     $driver = new $className($data["PLUGIN_ID"], $data["BASE_DIR"]);
     $driver->loadManifest();
     $driver->init($data["REPOSITORY"], $data["OPTIONS"]);
     ConfService::setRepository($data["REPOSITORY"]);
     $driver->initRepository();
     $driver->switchAction($data["ACTION"], array("file" => $data["FILE_PATH"]), "");
 }
开发者ID:umbecr,项目名称:camilaframework,代码行数:32,代码来源:class.AbstractAccessDriver.php

示例2: loadPubliclet

 /** Load a uncyphered publiclet */
 function loadPubliclet($data)
 {
     // create driver from $data
     $className = $data["DRIVER"] . "AccessDriver";
     if ($data["EXPIRE_TIME"] && time() > $data["EXPIRE_TIME"]) {
         // Remove the publiclet, it's done
         if (strstr(realpath($_SERVER["SCRIPT_FILENAME"]), realpath(PUBLIC_DOWNLOAD_FOLDER)) !== FALSE) {
             $hash = md5(serialize($data));
             require_once INSTALL_PATH . "/server/classes/class.PublicletCounter.php";
             PublicletCounter::delete($hash);
             unlink($_SERVER["SCRIPT_FILENAME"]);
         }
         echo "Link is expired, sorry.";
         exit;
     }
     // Check password
     if (strlen($data["PASSWORD"])) {
         if (!isset($_POST['password']) || $_POST['password'] != $data["PASSWORD"]) {
             $content = file_get_contents(INSTALL_PATH . "/client/html/public_links.html");
             $language = "en";
             if (isset($_GET["lang"])) {
                 $language = $_GET["lang"];
             }
             $messages = array();
             if (is_file(INSTALL_PATH . "/client/i18n/{$language}.php")) {
                 include INSTALL_PATH . "/client/i18n/{$language}.php";
                 $messages = $mess;
             }
             if (preg_match_all("/AJXP_MESSAGE(\\[.*?\\])/", $content, $matches, PREG_SET_ORDER)) {
                 foreach ($matches as $match) {
                     $messId = str_replace("]", "", str_replace("[", "", $match[1]));
                     if (isset($messages[$messId])) {
                         $content = str_replace("AJXP_MESSAGE[{$messId}]", $messages[$messId], $content);
                     }
                 }
             }
             echo $content;
             exit(1);
         }
     }
     $filePath = INSTALL_PATH . "/plugins/access." . $data["DRIVER"] . "/class." . $className . ".php";
     if (!is_file($filePath)) {
         die("Warning, cannot find driver for conf storage! ({$name}, {$filePath})");
     }
     require_once $filePath;
     $driver = new $className($data["PLUGIN_ID"], $data["BASE_DIR"]);
     $driver->loadManifest();
     $driver->init($data["REPOSITORY"], $data["OPTIONS"]);
     ConfService::setRepository($data["REPOSITORY"]);
     $driver->initRepository();
     // Increment counter
     $hash = md5(serialize($data));
     require_once INSTALL_PATH . "/server/classes/class.PublicletCounter.php";
     PublicletCounter::increment($hash);
     // Now call switchAction
     //@todo : switchAction should not be hard coded here!!!
     // Re-encode file-path as it will be decoded by the action.
     try {
         $driver->switchAction($data["ACTION"], array("file" => SystemTextEncoding::toUTF8($data["FILE_PATH"])), "");
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }
开发者ID:pussbb,项目名称:CI_DEV_CMS,代码行数:64,代码来源:class.AbstractAccessDriver.php


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