本文整理汇总了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";
}
}
}
}
}
}
示例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;
}
}
示例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";
}
}
}
}
示例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);
}
}
}