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";
# Default server display mode - Overridden by host
# Default output format - Overridden by host
# specific configurations.
$this->mode = "web";
$this->format = "html";
# When enabled, environment and more is set based

View File

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

View File

@@ -5,7 +5,7 @@
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
@@ -36,10 +36,10 @@ class ActionBase {
public
# Components
$env, // ActionEnvironment
$view, // ActionView
$log, // ActiveLog
$locale, // ActiveLocale
$env, // ActionEnvironment
$view, // ActionView
$log, // ActiveLog
$locale, // ActiveLocale
$session, // ActiveSession
# Paths
@@ -55,11 +55,11 @@ class ActionBase {
$started = false;
function __construct () {
public function __construct () {
}
function __sleep () {
public function __sleep () {
$blacklist = array_flip(array("env", "view", "log", "locale"));
$save = array();
foreach( $this as $key => $value ) {
@@ -70,16 +70,16 @@ class ActionBase {
return $save;
}
function __wakeup () {
public function __wakeup () {
}
function init () {
public function init () {
$this->set_paths();
$this->started = true;
}
function set_paths () {
private function set_paths () {
$this->apps_path = ZNAP_ROOT."/apps";
$this->lib_path = ZNAP_ROOT."/lib";
$this->log_path = ZNAP_ROOT."/log";

View File

@@ -5,7 +5,7 @@
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
@@ -37,7 +37,7 @@ class ActionEnvironment {
# Main
$environment,
$mode,
$format,
$root,
# Components
@@ -62,6 +62,7 @@ class ActionEnvironment {
}
function __wakeup () {
$this->set_include_paths();
$this->define_constants();
}
@@ -82,7 +83,7 @@ class ActionEnvironment {
$host = $this->match_to_host($hosts);
if ( !empty($host) ) {
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($_SERVER['REQUEST_URI']) ) $_SERVER['REQUEST_URI'] = '/'.$host['root'].$_SERVER['REQUEST_URI'];
if ( !empty($_SERVER['REDIRECT_URL']) ) $_SERVER['REDIRECT_URL'] = '/'.$host['root'].$_SERVER['REDIRECT_URL'];
@@ -114,9 +115,6 @@ class ActionEnvironment {
if ( !defined("ZNAP_ENV") ) {
define("ZNAP_ENV", $this->environment);
}
if ( !defined("ZNAP_MODE") ) {
define("ZNAP_MODE", $this->mode);
}
}
function match_to_host ($list = array()) {

View File

@@ -5,7 +5,7 @@
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

View File

@@ -5,7 +5,7 @@
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

View File

@@ -5,7 +5,7 @@
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