a small number of tweaks

This commit is contained in:
2010-01-14 05:03:12 +02:00
parent 581b675c87
commit 5530d124c6
7 changed files with 23 additions and 25 deletions

View File

@@ -15,9 +15,9 @@
$this->environment = "development"; $this->environment = "development";
# Default server display mode - Overridden by host # Default output format - Overridden by host
# specific configurations. # specific configurations.
$this->mode = "web"; $this->format = "html";
# When enabled, environment and more is set based # When enabled, environment and more is set based

View File

@@ -8,15 +8,15 @@
# host configuration # host configuration
# - set environment, display mode, and root path for # - set environment, default format, and root path for
# specific hosts. available options are "environment", # specific hosts. available options are "environment",
# "mode", and "root". # "format", and "root".
$hosts = array( $hosts = array(
// "zynapse" => array( // "zynapse" => array(
// //
// ), // ),
// "wap.zynapse" => array( // "iphone.zynapse" => array(
// "mode" => "wap", // "format" => "iphone",
// ), // ),
// "admin.zynapse" => array( // "admin.zynapse" => array(
// "root" => "admin", // "root" => "admin",

View File

@@ -5,7 +5,7 @@
http://www.zynapse.org/ http://www.zynapse.org/
Copyright (c) 2009 Jim Myhrberg. Copyright (c) 2010 Jim Myhrberg.
---------- ----------
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
@@ -36,10 +36,10 @@ class ActionBase {
public public
# Components # Components
$env, // ActionEnvironment $env, // ActionEnvironment
$view, // ActionView $view, // ActionView
$log, // ActiveLog $log, // ActiveLog
$locale, // ActiveLocale $locale, // ActiveLocale
$session, // ActiveSession $session, // ActiveSession
# Paths # Paths
@@ -55,11 +55,11 @@ class ActionBase {
$started = false; $started = false;
function __construct () { public function __construct () {
} }
function __sleep () { public function __sleep () {
$blacklist = array_flip(array("env", "view", "log", "locale")); $blacklist = array_flip(array("env", "view", "log", "locale"));
$save = array(); $save = array();
foreach( $this as $key => $value ) { foreach( $this as $key => $value ) {
@@ -70,16 +70,16 @@ class ActionBase {
return $save; return $save;
} }
function __wakeup () { public function __wakeup () {
} }
function init () { public function init () {
$this->set_paths(); $this->set_paths();
$this->started = true; $this->started = true;
} }
function set_paths () { private function set_paths () {
$this->apps_path = ZNAP_ROOT."/apps"; $this->apps_path = ZNAP_ROOT."/apps";
$this->lib_path = ZNAP_ROOT."/lib"; $this->lib_path = ZNAP_ROOT."/lib";
$this->log_path = ZNAP_ROOT."/log"; $this->log_path = ZNAP_ROOT."/log";

View File

@@ -5,7 +5,7 @@
http://www.zynapse.org/ http://www.zynapse.org/
Copyright (c) 2009 Jim Myhrberg. Copyright (c) 2010 Jim Myhrberg.
---------- ----------
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
@@ -37,7 +37,7 @@ class ActionEnvironment {
# Main # Main
$environment, $environment,
$mode, $format,
$root, $root,
# Components # Components
@@ -62,6 +62,7 @@ class ActionEnvironment {
} }
function __wakeup () { function __wakeup () {
$this->set_include_paths();
$this->define_constants(); $this->define_constants();
} }
@@ -82,7 +83,7 @@ class ActionEnvironment {
$host = $this->match_to_host($hosts); $host = $this->match_to_host($hosts);
if ( !empty($host) ) { if ( !empty($host) ) {
if ( !empty($host['environment']) ) $this->environment = $host['environment']; if ( !empty($host['environment']) ) $this->environment = $host['environment'];
if ( !empty($host['mode']) ) $this->mode = $host['mode']; if ( !empty($host['format']) ) $this->format = $host['format'];
if ( !empty($host['root']) ) { if ( !empty($host['root']) ) {
if ( !empty($_SERVER['REQUEST_URI']) ) $_SERVER['REQUEST_URI'] = '/'.$host['root'].$_SERVER['REQUEST_URI']; if ( !empty($_SERVER['REQUEST_URI']) ) $_SERVER['REQUEST_URI'] = '/'.$host['root'].$_SERVER['REQUEST_URI'];
if ( !empty($_SERVER['REDIRECT_URL']) ) $_SERVER['REDIRECT_URL'] = '/'.$host['root'].$_SERVER['REDIRECT_URL']; if ( !empty($_SERVER['REDIRECT_URL']) ) $_SERVER['REDIRECT_URL'] = '/'.$host['root'].$_SERVER['REDIRECT_URL'];
@@ -114,9 +115,6 @@ class ActionEnvironment {
if ( !defined("ZNAP_ENV") ) { if ( !defined("ZNAP_ENV") ) {
define("ZNAP_ENV", $this->environment); define("ZNAP_ENV", $this->environment);
} }
if ( !defined("ZNAP_MODE") ) {
define("ZNAP_MODE", $this->mode);
}
} }
function match_to_host ($list = array()) { function match_to_host ($list = array()) {

View File

@@ -5,7 +5,7 @@
http://www.zynapse.org/ http://www.zynapse.org/
Copyright (c) 2009 Jim Myhrberg. Copyright (c) 2010 Jim Myhrberg.
---------- ----------
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining

View File

@@ -5,7 +5,7 @@
http://www.zynapse.org/ http://www.zynapse.org/
Copyright (c) 2009 Jim Myhrberg. Copyright (c) 2010 Jim Myhrberg.
---------- ----------
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining

View File

@@ -5,7 +5,7 @@
http://www.zynapse.org/ http://www.zynapse.org/
Copyright (c) 2009 Jim Myhrberg. Copyright (c) 2010 Jim Myhrberg.
---------- ----------
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining