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


PHP Storage::Get方法代码示例

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


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

示例1: Cache

 /**
  * Função para definir uso de cache na Query
  * 
  * @access public
  * @return \MySQLTableCached
  */
 public function Cache($iTimeout = 3600)
 {
     Storage::Set("cachedb.timeout", $iTimeout);
     Events::Set("BeforeQuery", function ($sSQL, $fCallback) {
         if (Storage::Get("cachedb.enabled", false)) {
             $mCache = @CacheDB::Get(sha1($sSQL));
             if ($mCache !== false && !is_null($mCache)) {
                 if ($fCallback) {
                     $fCallback(json_decode($mCache, true), null);
                 }
                 return true;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     });
     Events::Set("AfterQuery", function ($sSQL, $aResult) {
         if (Storage::Get("cachedb.enabled", false)) {
             @CacheDB::Set(sha1($sSQL), json_encode($aResult), Storage::Get("cachedb.timeout", 3600));
         }
     });
     return $this;
 }
开发者ID:magicphp,项目名称:cachedb,代码行数:31,代码来源:mysqlcache.class.php

示例2: Call

 /**
  * Function to call the event
  * 
  * @static
  * @access public
  * @param string $sName
  * @param array $aParams
  * @return mixed
  */
 public static function Call($sName, $aParams = null)
 {
     $oThis = self::CreateInstanceIfNotExists();
     $sName = strtolower(str_replace(array("/", "\\", "--"), "-", $sName));
     //Bugfix
     if (array_key_exists($sName, $oThis->aEvents)) {
         switch ($oThis->aEvents[$sName]["type"]) {
             case "perroute":
                 $sCurrentRoute = strtolower(str_replace(array("/", "\\", "--"), "-", Storage::Get("route")));
                 //Bugfix
                 $sRoute = strtolower($oThis->aEvents[$sName]["method"] . "_" . $oThis->aEvents[$sName]["route"]);
                 if ($sRoute == $sCurrentRoute) {
                     return call_user_func($oThis->aEvents[$sName]["func"], $aParams);
                 }
                 break;
             case "default":
                 return call_user_func($oThis->aEvents[$sName]["func"], $aParams);
                 break;
         }
     } else {
         return false;
     }
 }
开发者ID:magicphp,项目名称:framework,代码行数:32,代码来源:events.class.php

示例3: LoadApp

 /**
  * Function to load modules
  * 
  * @static
  * @access public
  * @return void
  */
 public static function LoadApp()
 {
     //If the module exists Express should be loaded first
     if (is_dir(Storage::Join("dir.app", "express"))) {
         if (file_exists(Storage::Join("dir.app", "express" . SP . "settings.php"))) {
             require_once Storage::Join("dir.app", "express" . SP . "settings.php");
         }
         if (file_exists(Storage::Join("dir.app", "express" . SP . "include.php"))) {
             require_once Storage::Join("dir.app", "express" . SP . "include.php");
         }
         if (file_exists(Storage::Join("dir.app", "express" . SP . "routes.php"))) {
             require_once Storage::Join("dir.app", "express" . SP . "routes.php");
         }
         if (file_exists(Storage::Join("dir.app", "express" . SP . "events.php"))) {
             require_once Storage::Join("dir.app", "express" . SP . "events.php");
         }
     }
     //Load Modules
     $aModulesDirectories = glob(Storage::Get("dir.app") . "*", GLOB_ONLYDIR);
     foreach ($aModulesDirectories as $sModuleDiretory) {
         $bStatus = file_exists($sModuleDiretory . SP . "status.txt") ? intval(file_get_contents($sModuleDiretory . SP . "status.txt")) == 1 : false;
         $bInstaled = file_exists($sModuleDiretory . SP . "settings.php");
         if ($bStatus && $bInstaled && basename($sModuleDiretory) != "express") {
             if (file_exists($sModuleDiretory . SP . "settings.php") && $bStatus) {
                 require_once $sModuleDiretory . SP . "settings.php";
             }
             if (file_exists($sModuleDiretory . SP . "include.php") && $bStatus) {
                 require_once $sModuleDiretory . SP . "include.php";
             }
             if (file_exists($sModuleDiretory . SP . "routes.php") && $bStatus) {
                 require_once $sModuleDiretory . SP . "routes.php";
             }
             if (file_exists($sModuleDiretory . SP . "events.php") && $bStatus) {
                 require_once $sModuleDiretory . SP . "events.php";
             }
         }
     }
 }
开发者ID:magicphp,项目名称:magicphp,代码行数:45,代码来源:bootstrap.php

示例4: Send

 /**
  * Function to send output
  *
  * @access public
  * @return void
  */
 public static function Send()
 {
     $oThis = self::CreateInstanceIfNotExists();
     if (is_object($oThis->oSmarty)) {
         $oThis->CreateCacheCSS();
         $oThis->CreateCacheJS();
         Storage::AssignSmarty($oThis->oSmarty);
         Events::Call("BeforeSendingOutput");
         $oThis->oSmarty->display($oThis->sTemplateFilename);
     } else {
         $oThis = self::CreateInstanceIfNotExists();
         $oThis->CreateCacheCSS();
         $oThis->CreateCacheJS();
         $oThis->IncludeTemplate();
         $oThis->ReplaceVars();
         $oThis->RemoveUndefinedVars();
         $oThis->CheckConditions();
         //$oThis->ClearList();
         Events::Call("BeforeSendingOutput");
         @header('HTTP/1.1 200 OK');
         @header("Content-Type: text/html; charset=" . strtoupper(Storage::Get("app.charset", "UTF-8")), true);
         try {
             //var_dump($oThis->sBuffer); die();
             eval('?> ' . $oThis->sBuffer);
             die;
         } catch (Exception $e) {
             die($e->getMessage());
         }
     }
 }
开发者ID:magicphp,项目名称:framework,代码行数:36,代码来源:output.class.php


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