From 5530d124c6a741111ae63d1ec4cc936ec2f231e2 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 14 Jan 2010 05:03:12 +0200 Subject: [PATCH] a small number of tweaks --- config/environment.php | 4 ++-- config/hosts.php | 8 ++++---- vendor/zynapse/action_base.php | 20 ++++++++++---------- vendor/zynapse/action_environment.php | 10 ++++------ vendor/zynapse/action_view.php | 2 +- vendor/zynapse/active_session.php | 2 +- vendor/zynapse/zynapse.php | 2 +- 7 files changed, 23 insertions(+), 25 deletions(-) diff --git a/config/environment.php b/config/environment.php index b08920f..f0e917b 100644 --- a/config/environment.php +++ b/config/environment.php @@ -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 diff --git a/config/hosts.php b/config/hosts.php index 561be64..2b5d0cf 100644 --- a/config/hosts.php +++ b/config/hosts.php @@ -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", diff --git a/vendor/zynapse/action_base.php b/vendor/zynapse/action_base.php index ce806cd..cd57561 100644 --- a/vendor/zynapse/action_base.php +++ b/vendor/zynapse/action_base.php @@ -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"; diff --git a/vendor/zynapse/action_environment.php b/vendor/zynapse/action_environment.php index bb9c6e9..3347288 100644 --- a/vendor/zynapse/action_environment.php +++ b/vendor/zynapse/action_environment.php @@ -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()) { diff --git a/vendor/zynapse/action_view.php b/vendor/zynapse/action_view.php index 4187518..9acfb57 100644 --- a/vendor/zynapse/action_view.php +++ b/vendor/zynapse/action_view.php @@ -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 diff --git a/vendor/zynapse/active_session.php b/vendor/zynapse/active_session.php index 1a128a8..4e2141b 100644 --- a/vendor/zynapse/active_session.php +++ b/vendor/zynapse/active_session.php @@ -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 diff --git a/vendor/zynapse/zynapse.php b/vendor/zynapse/zynapse.php index 31d8b0d..9c7cc7a 100644 --- a/vendor/zynapse/zynapse.php +++ b/vendor/zynapse/zynapse.php @@ -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