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


PHP Storage::Join方法代码示例

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


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

示例1: Start

 /**
  * Function to start the module
  * 
  * @access public
  * @return void
  */
 public function Start()
 {
     if (file_exists($this->sModuleDiretory . SP . "status.txt")) {
         $iStatus = intval(file_get_contents($this->sModuleDiretory . SP . "status.txt"));
         $bStatus = $iStatus == 1;
         Storage::Set("app." . $this->sModuleName . ".enabled", $bStatus);
     } else {
         $bStatus = true;
         file_put_contents($this->sModuleDiretory . SP . "status.txt", "1");
         Storage::Set("app." . $this->sModuleName . ".enabled", true);
     }
     if ($bStatus) {
         Storage::SetArray("class.list", "module." . $this->sModuleName, $this->sModuleDiretory . "core" . SP);
         //Diretory Paths
         Storage::Set("app." . $this->sModuleName, $this->sModuleDiretory);
         Storage::Set("app." . $this->sModuleName . ".shell.css", $this->sModuleDiretory . "shell" . SP . "css" . SP);
         Storage::Set("app." . $this->sModuleName . ".shell.tpl", $this->sModuleDiretory . "shell" . SP . "tpl" . SP);
         Storage::Set("app." . $this->sModuleName . ".shell.js", $this->sModuleDiretory . "shell" . SP . "js" . SP);
         Storage::Set("app." . $this->sModuleName . ".shell.img", $this->sModuleDiretory . "shell" . SP . "img" . SP);
         //Web Paths
         Storage::Set("virtual." . $this->sModuleName . ".shell.img", Storage::Join("route.root", "app/" . $this->sModuleName . "/shell/img/"));
         Storage::Set("virtual." . $this->sModuleName . ".shell.tpl", Storage::Join("route.root", "app/" . $this->sModuleName . "/shell/tpl/"));
         Storage::Set("virtual." . $this->sModuleName . ".shell.js", Storage::Join("route.root", "app/" . $this->sModuleName . "/shell/js/"));
         Storage::Set("virtual." . $this->sModuleName . ".shell.css", Storage::Join("route.root", "app/" . $this->sModuleName . "/shell/css/"));
         //Loading submodules
         if (is_dir($this->sModuleDiretory . "modules")) {
             $aModulesDirectories = glob($this->sModuleDiretory . "modules" . SP . "*", GLOB_ONLYDIR);
             foreach ($aModulesDirectories as $sModuleDiretory) {
                 if (file_exists($sModuleDiretory . SP . "status.txt")) {
                     $bStatus = intval(file_get_contents($sModuleDiretory . SP . "status.txt")) == 1;
                 } else {
                     $bStatus = false;
                 }
                 if ($bStatus) {
                     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,项目名称:framework,代码行数:57,代码来源:module.class.php

示例2: CreateConnection

 /**
  * Function to create connections
  * 
  * @static
  * @access public
  * @param string $sName Connection name
  * @param string $sDrive Drive database to be used (mysql, postgresql, sqlite, mongodb)
  * @param string $sHostname Hostname or path to the database
  * @param string $sUsername User access to the database
  * @param string $sPassword Password to access the database
  * @param string $sSchema Schema to be used (for MySQL, PostgreSQL and MongoDB)
  * @param integer $iPort Door access to the database (for MySQL, PostgreSQL and MongoDB) 
  * @return void
  */
 public static function CreateConnection($sName, $sDrive = "mysql", $sHostname, $sUsername = null, $sPassword = null, $sSchema = null, $iPort = 3306)
 {
     $oThis = self::CreateInstanceIfNotExists();
     Storage::SetArray("class.list", "db", Storage::Join("dir.core", "db" . SP));
     $oThis->aConnections[$sName] = array("drive" => $sDrive);
     switch (strtolower($sDrive)) {
         case "mysql":
             $oThis->aConnections[$sName]["resource"] = new MySQLCache($sHostname, $sUsername, $sPassword, $sSchema, $iPort);
             break;
         default:
             unset($oThis->aConnections[$sName]);
             break;
     }
 }
开发者ID:magicphp,项目名称:cachedb,代码行数:28,代码来源:cachedb.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: CreateCacheJS

 /**
  * Function to create the Javascript file cache
  *
  * @access public
  * @param boolean $bForce Forcing creation
  * @return void
  */
 public static function CreateCacheJS()
 {
     $oThis = self::CreateInstanceIfNotExists();
     if (count($oThis->aJS) > 0) {
         $sCacheFilename = Storage::Join("dir.public.assets", strtolower($oThis->sNamespace) . ".js");
         Storage::Set("assets.js", Storage::Join("route.root", "public/assets/" . strtolower($oThis->sNamespace) . ".js"));
         if (!file_exists($sCacheFilename) || Storage::Get("debug", false)) {
             $sBuffer = "";
             foreach ($oThis->aJS as $sAppendBuffer) {
                 $sBuffer .= $sAppendBuffer;
             }
             file_put_contents($sCacheFilename, $sBuffer);
         }
     }
 }
开发者ID:magicphp,项目名称:framework,代码行数:22,代码来源:output.class.php


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