コード例 #1
0
 public function getSystemParameter()
 {
     $strHeaderName = class_config::readPlainConfigsFromFilesystem("https_header");
     $strHeaderValue = strtolower(class_config::readPlainConfigsFromFilesystem("https_header_value"));
     $arrSystemParameter = array();
     $arrSystemParameter["SCHEME"] = isset($_SERVER[$strHeaderName]) && strtolower($_SERVER[$strHeaderName]) == $strHeaderValue ? "https" : "http";
     $arrSystemParameter["HOSTNAME"] = $_SERVER['SERVER_NAME'];
     $strRequestUri = $_SERVER['REQUEST_URI'];
     $path_parts = pathinfo($strRequestUri);
     $arrSystemParameter["URLPATHNAME"] = $path_parts['dirname'];
     if ($arrSystemParameter["URLPATHNAME"][0] == "/") {
         $arrSystemParameter["URLPATHNAME"] = uniSubstr($arrSystemParameter["URLPATHNAME"], 1);
     }
     return $arrSystemParameter;
 }
コード例 #2
0
ファイル: bootstrap.php プロジェクト: jinshana/kajonacms
    rawIncludeError(_corepath_ . "/module_system/system/functions.php");
}
//Exception-Handler
if (!@(include_once _corepath_ . "/module_system/system/class_exception.php")) {
    rawIncludeError("global exception handler");
}
//register global exception handler for exceptions thrown but not catched (bad style ;) )
@set_exception_handler(array("class_exception", "globalExceptionHandler"));
//Include the logging-engine
if (!@(include_once _corepath_ . "/module_system/system/class_logger.php")) {
    rawIncludeError("logging engine");
}
//---The Path on web-------------------------------------------------------------------------------------
require_once _corepath_ . "/module_system/system/class_config.php";
$strHeaderName = class_config::readPlainConfigsFromFilesystem("https_header");
$strHeaderValue = strtolower(class_config::readPlainConfigsFromFilesystem("https_header_value"));
if (strpos($_SERVER['SCRIPT_FILENAME'], "/debug/")) {
    //Determine the current path on the web
    $strWeb = dirname((isset($_SERVER[$strHeaderName]) && strtolower($_SERVER[$strHeaderName]) == $strHeaderValue ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']);
    define("_webpath_", saveUrlEncode(substr_replace($strWeb, "", strrpos($strWeb, "/"))));
} else {
    //Determine the current path on the web
    $strWeb = dirname((isset($_SERVER[$strHeaderName]) && strtolower($_SERVER[$strHeaderName]) == $strHeaderValue ? "https://" : "http://") . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : "localhost") . $_SERVER['SCRIPT_NAME']);
    define("_webpath_", saveUrlEncode($strWeb));
}
//---Include Section 2-----------------------------------------------------------------------------------
//load module-ids
bootstrapIncludeModuleIds();
//---Auto-Loader for classes-----------------------------------------------------------------------------
require_once _corepath_ . "/module_system/system/class_classloader.php";
spl_autoload_register(array(class_classloader::getInstance(), "loadClass"));
コード例 #3
0
 public function testStaticReader()
 {
     $this->assertEquals(class_config::readPlainConfigsFromFilesystem("https_header"), "HTTPS");
 }