mirror of
https://github.com/jimeh/zynapse.git
synced 2026-02-19 07:06:39 +00:00
Moved the main path config's out of ActionEnvironment and into ActionBase where they make more sense to be.
This commit is contained in:
32
vendor/zynapse/action_base.php
vendored
32
vendor/zynapse/action_base.php
vendored
@@ -32,6 +32,38 @@
|
||||
|
||||
|
||||
class ActionBase {
|
||||
|
||||
public
|
||||
|
||||
# components
|
||||
$env, // ActionEnvironment
|
||||
$view, // ActionView
|
||||
$locale, // ActionLocale
|
||||
$log, // ActionLog
|
||||
|
||||
# paths
|
||||
$apps_path,
|
||||
$lib_path,
|
||||
$log_path,
|
||||
$public_path,
|
||||
$tmp_path,
|
||||
$cache_path,
|
||||
$script_path;
|
||||
|
||||
|
||||
function __construct () {
|
||||
$this->set_paths();
|
||||
}
|
||||
|
||||
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 . "/log";
|
||||
$this->script_path = ZNAP_ROOT . "/script";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
23
vendor/zynapse/action_environment.php
vendored
23
vendor/zynapse/action_environment.php
vendored
@@ -54,7 +54,6 @@ class ActionEnvironment {
|
||||
$path_separator;
|
||||
|
||||
function __construct () {
|
||||
$this->set_paths();
|
||||
$this->set_include_paths();
|
||||
$this->load_environment_file();
|
||||
}
|
||||
@@ -72,10 +71,6 @@ class ActionEnvironment {
|
||||
$this->define_constants();
|
||||
}
|
||||
|
||||
function load_environment_specific_file () {
|
||||
require_once(ZNAP_CONFIG . "/environments/". $this->env . ".php");
|
||||
}
|
||||
|
||||
function load_hosts_file () {
|
||||
require_once(ZNAP_CONFIG . "/hosts.php");
|
||||
$host = $this->match_to_host($hosts);
|
||||
@@ -89,14 +84,8 @@ class ActionEnvironment {
|
||||
}
|
||||
}
|
||||
|
||||
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 . "/log";
|
||||
$this->script_path = ZNAP_ROOT . "/script";
|
||||
function load_environment_specific_file () {
|
||||
require_once(ZNAP_CONFIG . "/environments/". $this->env . ".php");
|
||||
}
|
||||
|
||||
function set_include_paths () {
|
||||
@@ -116,8 +105,12 @@ class ActionEnvironment {
|
||||
}
|
||||
|
||||
function define_constants () {
|
||||
define("ZNAP_ENV", $this->env);
|
||||
define("ZNAP_MODE", $this->mode);
|
||||
if ( !defined("ZNAP_ENV") ) {
|
||||
define("ZNAP_ENV", $this->env);
|
||||
}
|
||||
if ( !defined("ZNAP_MODE") ) {
|
||||
define("ZNAP_MODE", $this->mode);
|
||||
}
|
||||
}
|
||||
|
||||
function match_to_host ($list = array()) {
|
||||
|
||||
3
vendor/zynapse/zynapse.php
vendored
3
vendor/zynapse/zynapse.php
vendored
@@ -47,6 +47,9 @@ class Zynapse {
|
||||
require_once(ZNAP_LIB_ROOT . "/active_session.php");
|
||||
|
||||
self::$env = new ActionEnvironment();
|
||||
self::$base = new ActionBase();
|
||||
|
||||
self::$base->env =& self::$env;
|
||||
|
||||
echo "hello world<br />\n";
|
||||
echo self::$env->env;
|
||||
|
||||
Reference in New Issue
Block a user