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


PHP Environment::load方法代码示例

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


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

示例1: getS

 public static function getS($value, $default)
 {
     Environment::load();
     $return = Environment::$currentEnvironment->get($value, $default);
     switch ($value) {
         case "onLogout":
             return str_replace("%CLOUDUSER", Environment::$currentEnvironment->cloudUser(), $return);
             break;
         case "databaseData":
             if (is_array($return)) {
                 return $return;
             }
             $ex = explode(";;", $return);
             $dbData = array();
             $dbData["host"] = $ex[0];
             $dbData["user"] = $ex[1];
             $dbData["password"] = $ex[2];
             $dbData["httpHost"] = "*";
             $dbData["datab"] = $ex[3];
             $return = $dbData;
             break;
         case "allowedApplications":
             if ($return == null) {
                 return null;
             }
             return explode(",", $return);
             break;
         case "pluginsExtra":
         case "allowedPlugins":
         case "hiddenPlugins":
             if ($return == null) {
                 return $default;
             }
             return explode(",", $return);
             break;
         case "customizer":
         case "customizerExtra":
             if ($return == null) {
                 return $default;
             }
             return explode(",", $return);
             break;
     }
     $return = Aspect::joinPoint("alter", null, __METHOD__, array($value, $default), $return);
     return $return;
 }
开发者ID:nemiah,项目名称:trinityDB,代码行数:46,代码来源:Environment.class.php

示例2: getS

 public static function getS($value, $default, $forceReload = false)
 {
     Environment::load($forceReload);
     $return = Environment::$currentEnvironment->get($value, $default);
     switch ($value) {
         case "usePWEncryption":
             try {
                 $LD = LoginData::get("ADServerUserPass");
                 if ($LD != null and $LD->A("server") != "") {
                     return false;
                 }
             } catch (Exception $e) {
             }
             return true;
             break;
         case "onLogout":
         case "onTimeout":
             return str_replace("%CLOUDUSER", Environment::$currentEnvironment->cloudUser(), $return);
             break;
         case "databaseData":
             if (is_array($return)) {
                 return $return;
             }
             $ex = explode(";;", $return);
             $dbData = array();
             $dbData["host"] = $ex[0];
             $dbData["user"] = $ex[1];
             $dbData["password"] = $ex[2];
             $dbData["httpHost"] = "*";
             $dbData["datab"] = $ex[3];
             $return = $dbData;
             break;
         case "databaseDataWrite":
             if ($return == null) {
                 return null;
             }
             if (is_array($return)) {
                 return $return;
             }
             $ex = explode(";;", $return);
             $dbData = array();
             $dbData["host"] = $ex[0];
             $dbData["user"] = $ex[1];
             $dbData["password"] = $ex[2];
             $dbData["httpHost"] = "*";
             $dbData["datab"] = $ex[3];
             $return = $dbData;
         case "allowedApplications":
             if ($return == null) {
                 return null;
             }
             return explode(",", $return);
             break;
         case "pluginsExtra":
         case "allowedPlugins":
         case "hiddenPlugins":
             if ($return == null) {
                 return $default;
             }
             return explode(",", $return);
             break;
         case "customizer":
         case "customizerExtra":
             if ($return == null) {
                 return $default;
             }
             return explode(",", $return);
             break;
     }
     $return = Aspect::joinPoint("alter", null, __METHOD__, array($value, $default), $return);
     return $return;
 }
开发者ID:nemiah,项目名称:poolPi,代码行数:72,代码来源:Environment.class.php

示例3: getTempDir

 public static function getTempDir()
 {
     $dirtouse = Util::getRootPath() . "system/IECache/";
     if (!is_writable($dirtouse)) {
         $file = tempnam(":\n\\/?><", "");
         $dirtouse = dirname($file);
         unlink($file);
     } else {
         Util::clearIECache($dirtouse);
     }
     $subdir = (isset($_SESSION["S"]) and $_SESSION["S"]->getCurrentUser() != null) ? $_SESSION["S"]->getCurrentUser()->getID() : "info";
     $CH = Util::getCloudHost();
     if ($CH !== null and get_class($CH) != "CloudHostAny") {
         $dirtouse = "/tmp";
         Environment::load();
         $subdir = Environment::$currentEnvironment->cloudUser() . "/{$subdir}";
     }
     $dirtouse .= ($dirtouse[strlen($dirtouse) - 1] != "/" ? "/" : "") . $subdir . "/";
     if (!is_dir($dirtouse)) {
         #echo "create $dirtouse...\n";
         if (!mkdir($dirtouse, 0777, true)) {
             throw new Exception("Could not create temp dir " . $dirtouse);
         }
         chmod($dirtouse . "../", 0777);
         chmod($dirtouse, 0777);
     } else {
         chmod($dirtouse . "../", 0777);
         chmod($dirtouse, 0777);
     }
     if (!is_dir($dirtouse)) {
         throw new Exception("Did not create temp dir {$dirtouse}");
     }
     #echo gethostname().":";
     #var_dump(is_dir($dirtouse));
     #print_r($dirtouse);
     #die();
     if (PHYNX_USE_TEMP_HTACCESS and strpos($dirtouse, Util::getRootPath()) !== false and is_writable($dirtouse)) {
         $content = "<IfModule mod_authz_core.c>\n    Require ip " . $_SERVER["REMOTE_ADDR"] . "\n</IfModule>";
         if (strstr($_SERVER["REMOTE_ADDR"], ".")) {
             //USE ONLY WHEN ON IPV4 due to APACHE BUG https://issues.apache.org/bugzilla/show_bug.cgi?id=49737
             $content .= "\n<IfModule !mod_authz_core.c>\n\tallow from " . $_SERVER["REMOTE_ADDR"] . "\n\tdeny from all\n\tallow from " . $_SERVER["REMOTE_ADDR"] . "\n</IfModule>";
         }
         file_put_contents($dirtouse . ".htaccess", $content);
     } elseif (file_exists($dirtouse . ".htaccess")) {
         unlink($dirtouse . ".htaccess");
     }
     if (!PHYNX_USE_TEMP_HTACCESS and file_exists($dirtouse . ".htaccess")) {
         unlink($dirtouse . ".htaccess");
     }
     return $dirtouse;
 }
开发者ID:nemiah,项目名称:fheME,代码行数:51,代码来源:Util.class.php

示例4: getFilesDir

 public static function getFilesDir()
 {
     $CH = Util::getCloudHost();
     if ($CH != null) {
         Environment::load();
         $dir = $CH->scientiaDir . "/" . strtolower(Environment::$currentEnvironment->cloudUser()) . "/specifics/";
         if (!file_exists($dir)) {
             #mkdir($CH->scientiaDir."/".strtolower(Environment::$currentEnvironment->cloudUser())."/");
             mkdir($CH->scientiaDir . "/" . strtolower(Environment::$currentEnvironment->cloudUser()) . "/specifics/", 0777, true);
         }
         return $dir;
     }
     return realpath(Util::getRootPath() . "specifics") . "/";
 }
开发者ID:nemiah,项目名称:projectMankind,代码行数:14,代码来源:FileStorage.class.php

示例5: getFilesDir

 public static function getFilesDir()
 {
     $path = realpath(Util::getRootPath()) . "/specifics/";
     if (!file_exists($path . ".htaccess") and is_writable($path)) {
         file_put_contents($path . ".htaccess", "<IfModule mod_authz_core.c>\n    Require all denied\n</IfModule>\n\n<IfModule !mod_authz_core.c>\n    Order Allow,Deny\n    Deny from all\n</IfModule>");
     }
     $CH = Util::getCloudHost();
     if ($CH != null) {
         Environment::load();
         $cloudUser = strtolower(Environment::$currentEnvironment->cloudUser());
         $dir = $CH->scientiaDir . "/" . ($cloudUser != "" ? "{$cloudUser}/" : "") . "specifics/";
         if (!file_exists($dir)) {
             #mkdir($CH->scientiaDir."/".strtolower(Environment::$currentEnvironment->cloudUser())."/");
             mkdir($dir, 0777, true);
             chmod($dir, 0777);
         }
         return realpath($dir) . "/";
     }
     return $path;
 }
开发者ID:nemiah,项目名称:poolPi,代码行数:20,代码来源:FileStorage.class.php

示例6: getFilesDir

 public static function getFilesDir()
 {
     $path = realpath(Util::getRootPath() . "specifics") . "/";
     if (!file_exists($path . ".htaccess") and is_writable($path)) {
         file_put_contents($path . ".htaccess", "deny from all");
     }
     $CH = Util::getCloudHost();
     if ($CH != null) {
         Environment::load();
         $cloudUser = strtolower(Environment::$currentEnvironment->cloudUser());
         $dir = $CH->scientiaDir . "/" . ($cloudUser != "" ? "{$cloudUser}/" : "") . "specifics/";
         if (!file_exists($dir)) {
             #mkdir($CH->scientiaDir."/".strtolower(Environment::$currentEnvironment->cloudUser())."/");
             mkdir($CH->scientiaDir . "/" . ($cloudUser != "" ? "{$cloudUser}/" : "") . "specifics/", 0777, true);
         }
         return $dir;
     }
     return $path;
 }
开发者ID:nemiah,项目名称:trinityDB,代码行数:19,代码来源:FileStorage.class.php


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