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 <?php
/*
Hosts
- configure host specific environment settings
*/
# host configuration # host configuration
# - set environment, display mode, and root path for # - set environment, display mode, and root path for

View File

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

View File

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

View File

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