mirror of
https://github.com/jimeh/zynapse.git
synced 2026-02-18 23:06:38 +00:00
Misc changes, and inital tests with serializing and unserializing core objects.
This commit is contained in:
17
vendor/zynapse/action_base.php
vendored
17
vendor/zynapse/action_base.php
vendored
@@ -55,6 +55,21 @@ class ActionBase {
|
||||
|
||||
}
|
||||
|
||||
function __sleep () {
|
||||
$blacklist = array_flip(array("env", "view", "log", "locale"));
|
||||
$save = array();
|
||||
foreach( $this as $key => $value ) {
|
||||
if ( !array_key_exists($key, $blacklist) ) {
|
||||
$save[] = $key;
|
||||
}
|
||||
}
|
||||
return $save;
|
||||
}
|
||||
|
||||
function __wakeup () {
|
||||
|
||||
}
|
||||
|
||||
function init () {
|
||||
$this->set_paths();
|
||||
}
|
||||
@@ -65,7 +80,7 @@ class ActionBase {
|
||||
$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->cache_path = $this->tmp_path . "/cache";
|
||||
$this->script_path = ZNAP_ROOT . "/script";
|
||||
}
|
||||
|
||||
|
||||
3
vendor/zynapse/action_environment.php
vendored
3
vendor/zynapse/action_environment.php
vendored
@@ -59,6 +59,9 @@ class ActionEnvironment {
|
||||
if ( !empty($enable_host_specific_configuration) ) {
|
||||
$this->load_hosts_file();
|
||||
}
|
||||
if ( !empty($_SERVER['ZNAP_ENV']) ) {
|
||||
$this->environment = $_SERVER['ZNAP_ENV'];
|
||||
}
|
||||
$this->load_environment_specific_file();
|
||||
$this->define_constants();
|
||||
}
|
||||
|
||||
8
vendor/zynapse/zynapse.php
vendored
8
vendor/zynapse/zynapse.php
vendored
@@ -48,14 +48,18 @@ class Zynapse {
|
||||
require_once(ZNAP_LIB_ROOT . "/action_base.php");
|
||||
require_once(ZNAP_LIB_ROOT . "/active_session.php");
|
||||
|
||||
$start = microtime(true);
|
||||
self::$env = new ActionEnvironment();
|
||||
|
||||
self::$base = new ActionBase();
|
||||
self::$base->init();
|
||||
self::$base->env =& self::$env;
|
||||
|
||||
echo microtime(true) - $start . "<br />\n";
|
||||
echo "hello world<br />\n";
|
||||
echo self::$env->environment;
|
||||
echo self::$env->environment . "<br />\n<br />\n";
|
||||
|
||||
// echo serialize(self::$env) . "<br />\n<br />\n";
|
||||
// echo serialize(self::$base) . "<br />\n<br />\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user