Some cleanup, and code style changes.

This commit is contained in:
2009-08-17 14:33:23 +03:00
parent 776a0ca8a1
commit b3c17af11c
6 changed files with 38 additions and 41 deletions

View File

@@ -12,12 +12,12 @@
# configurations.
#
# ( development | test | staging | production )
$this->environment = 'development';
$this->environment = "development";
# Default server display mode - Overridden by host
# specific configurations.
$this->mode = 'web';
$this->mode = "web";
# When enabled, environment and more is set based

View File

@@ -12,20 +12,20 @@
# specific hosts. available options are "environment",
# "mode", and "root".
$hosts = array(
// 'zynapse' => array(
// "zynapse" => array(
//
// ),
// 'wap.zynapse' => array(
// 'mode' => 'wap',
// "wap.zynapse" => array(
// "mode" => "wap",
// ),
// 'admin.zynapse' => array(
// 'root' => 'admin',
// "admin.zynapse" => array(
// "root" => "admin",
// ),
// '*zynapse.org' => array(
// 'environment' => 'production',
// "*zynapse.org" => array(
// "environment" => "production",
// ),
// 'admin.zynapse.org' => array(
// 'root' => 'admin',
// "admin.zynapse.org" => array(
// "root" => "admin",
// ),
);

View File

@@ -14,25 +14,25 @@ if ( !defined("ZNAP_ROOT") ) {
// set zynapse config path
define("ZNAP_CONFIG", ZNAP_ROOT . "/config");
define("ZNAP_CONFIG", ZNAP_ROOT."/config");
// include boot configuration
require_once(ZNAP_CONFIG . "/init/boot_config.php");
require_once(ZNAP_CONFIG."/init/boot_config.php");
// find zynapse libs
if ( !empty($zynapse_libs) && is_file($zynapse_libs . "/zynapse.php") ) {
if ( !empty($zynapse_libs) && is_file($zynapse_libs."/zynapse.php") ) {
define("ZNAP_LIB_ROOT", $zynapse_libs);
} elseif ( is_file(ZNAP_ROOT . "/vendor/zynapse/zynapse.php") ) {
define("ZNAP_LIB_ROOT", ZNAP_ROOT . "/vendor/zynapse");
} elseif ( is_file(dirname(ZNAP_ROOT) . "/vendor/zynapse/zynapse.php") ) {
define("ZNAP_LIB_ROOT", dirname(ZNAP_ROOT) . "/vendor/zynapse");
} elseif ( is_file(ZNAP_ROOT."/vendor/zynapse/zynapse.php") ) {
define("ZNAP_LIB_ROOT", ZNAP_ROOT."/vendor/zynapse");
} elseif ( is_file(dirname(ZNAP_ROOT)."/vendor/zynapse/zynapse.php") ) {
define("ZNAP_LIB_ROOT", dirname(ZNAP_ROOT)."/vendor/zynapse");
}
// require main zynapse class
require_once(ZNAP_LIB_ROOT . "/zynapse.php");
require_once(ZNAP_LIB_ROOT."/zynapse.php");
?>

View File

@@ -75,13 +75,13 @@ class ActionBase {
}
function set_paths () {
$this->apps_path = ZNAP_ROOT . "/apps";
$this->lib_path = ZNAP_ROOT . "/lib";
$this->log_path = ZNAP_ROOT . "/log";
$this->public_path = ZNAP_ROOT . "/public";
$this->tmp_path = ZNAP_ROOT . "/tmp";
$this->cache_path = $this->tmp_path . "/cache";
$this->script_path = ZNAP_ROOT . "/script";
$this->apps_path = ZNAP_ROOT."/apps";
$this->lib_path = ZNAP_ROOT."/lib";
$this->log_path = ZNAP_ROOT."/log";
$this->public_path = ZNAP_ROOT."/public";
$this->tmp_path = ZNAP_ROOT."/tmp";
$this->cache_path = $this->tmp_path."/cache";
$this->script_path = ZNAP_ROOT."/script";
}
}

View File

@@ -59,7 +59,7 @@ class ActionEnvironment {
}
function load_environment_file () {
require_once(ZNAP_CONFIG . "/environment.php");
require_once(ZNAP_CONFIG."/environment.php");
if ( !empty($enable_host_specific_configuration) ) {
$this->load_hosts_file();
}
@@ -71,7 +71,7 @@ class ActionEnvironment {
}
function load_hosts_file () {
require_once(ZNAP_CONFIG . "/hosts.php");
require_once(ZNAP_CONFIG."/hosts.php");
$host = $this->match_to_host($hosts);
if ( !empty($host) ) {
if ( !empty($host['environment']) ) $this->environment = $host['environment'];
@@ -84,7 +84,7 @@ class ActionEnvironment {
}
function load_environment_specific_file () {
require_once(ZNAP_CONFIG . "/environments/". $this->environment . ".php");
require_once(ZNAP_CONFIG."/environments/".$this->environment.".php");
}
function set_include_paths () {
@@ -96,9 +96,9 @@ class ActionEnvironment {
$this->path_seperator = ";";
}
ini_set("include_path",
'.' . $this->path_seperator .
ZNAP_LIB_ROOT . $this->path_seperator .
ZNAP_LIB_ROOT . "/script" . $this->path_seperator .
'.'.$this->path_seperator.
ZNAP_LIB_ROOT.$this->path_seperator.
ZNAP_LIB_ROOT."/script".$this->path_seperator.
ini_get('include_path')
);
}

View File

@@ -44,10 +44,10 @@ class Zynapse {
function init () {
require_once(ZNAP_LIB_ROOT . "/action_environment.php");
require_once(ZNAP_LIB_ROOT . "/action_base.php");
require_once(ZNAP_LIB_ROOT . "/action_view.php");
require_once(ZNAP_LIB_ROOT . "/active_session.php");
require_once(ZNAP_LIB_ROOT."/action_environment.php");
require_once(ZNAP_LIB_ROOT."/action_base.php");
require_once(ZNAP_LIB_ROOT."/action_view.php");
require_once(ZNAP_LIB_ROOT."/active_session.php");
$start = microtime(true);
@@ -55,12 +55,9 @@ class Zynapse {
self::init_base();
self::init_view();
echo microtime(true) - $start . "<br />\n";
echo microtime(true) - $start."<br />\n";
echo "hello world<br />\n";
echo self::$env->environment . "<br />\n<br />\n";
// echo serialize(self::$env) . "<br />\n<br />\n";
// echo serialize(self::$base) . "<br />\n<br />\n";
echo self::$env->environment."<br />\n<br />\n";
}
function init_env () {