Added some comments and whitespaces, yes, I added whitespace characters in a few places.

This commit is contained in:
2009-08-16 02:14:28 +03:00
parent e610d719b1
commit 3c1572ffb6
4 changed files with 18 additions and 7 deletions

View File

@@ -1,4 +1,10 @@
<?php
/*
Hosts
- configure host specific environment settings
*/
# host configuration
# - set environment, display mode, and root path for

View File

@@ -1,5 +1,10 @@
<?php
/*
Routes
- configure url parsing routes
*/
?>

View File

@@ -39,7 +39,7 @@ class ActionEnvironment {
$env,
$mode,
$root,
# paths
$apps_path,
$lib_path,
@@ -53,6 +53,7 @@ class ActionEnvironment {
$is_windows,
$path_separator;
function __construct () {
$this->set_include_paths();
$this->load_environment_file();
@@ -117,10 +118,10 @@ class ActionEnvironment {
if ( is_array($list) && !empty($list) ) {
$new_config = array();
foreach( $list as $host => $settings ) {
$regex = preg_quote($host, '/');
$regex = str_replace('\*', '.*', $regex);
$http_host = (substr($_SERVER['HTTP_HOST'], 0, 4) == 'www.') ? substr($_SERVER['HTTP_HOST'], 4) : $_SERVER['HTTP_HOST'] ;
if ( preg_match('/^'.$regex.'$/i', $http_host) ) {
$regex = preg_quote($host, "/");
$regex = str_replace("\*", ".*", $regex);
$http_host = (substr($_SERVER["HTTP_HOST"], 0, 4) == "www.") ? substr($_SERVER["HTTP_HOST"], 4) : $_SERVER["HTTP_HOST"] ;
if ( preg_match("/^".$regex."$/i", $http_host) ) {
foreach( $settings as $key => $value ) {
if ( !array_key_exists($key, $new_config) ) {
$new_config[$key] = $value;
@@ -132,7 +133,6 @@ class ActionEnvironment {
return (!empty($new_config)) ? $new_config : false ;
}
}
?>

View File

@@ -40,8 +40,8 @@ class Zynapse {
$locale, // ActionLocale
$log; // ActionLog
function init () {
require_once(ZNAP_LIB_ROOT . "/action_environment.php");
require_once(ZNAP_LIB_ROOT . "/action_base.php");
require_once(ZNAP_LIB_ROOT . "/active_session.php");