[switchyard] r780 committed - Cleanup some some things to take care of errors & warnings.

0 views
Skip to first unread message

codesite...@google.com

unread,
Sep 28, 2009, 11:07:48 AM9/28/09
to switchy...@googlegroups.com
Revision: 780
Author: intuiworx
Date: Mon Sep 28 08:06:48 2009
Log: Cleanup some some things to take care of errors & warnings.
http://code.google.com/p/switchyard/source/detail?r=780

Modified:
/framework/trunk/app/conf/config.xml
/framework/trunk/app/core/SwitchYard.class.php
/framework/trunk/app/core/SwitchYard_Config.class.php
/framework/trunk/app/core/SwitchYard_Router.class.php
/framework/trunk/app/core/SwitchYard_View_HTML.class.php
/framework/trunk/index.php

=======================================
--- /framework/trunk/app/conf/config.xml Thu Jun 4 13:49:03 2009
+++ /framework/trunk/app/conf/config.xml Mon Sep 28 08:06:48 2009
@@ -2,11 +2,8 @@
<configuration>

<debugging>true</debugging>
- <errlevel>E_ALL &amp; ~E_WARNING &amp; ~E_NOTICE</errlevel>
-
- <includepath>
- <!--<path>/path/to/libdir</path>-->
- </includepath>
+ <!--<errlevel>E_ALL &amp; ~E_WARNING &amp; ~E_NOTICE</errlevel>-->
+ <errlevel>E_ALL</errlevel>

<section prefix="DB_">
<value key="ENABLED">false</value>
=======================================
--- /framework/trunk/app/core/SwitchYard.class.php Mon Jun 29 14:06:49 2009
+++ /framework/trunk/app/core/SwitchYard.class.php Mon Sep 28 08:06:48 2009
@@ -32,9 +32,11 @@
*/
public static function doHandler($hook_name, $params = array())
{
- ksort(SwitchYard::$handlers[$hook_name], SORT_NUMERIC);
- foreach (SwitchYard::$handlers[$hook_name] as $priority => $handlers) {
- foreach ($handlers as $callback) call_user_func_array($callback,
$params);
+ if (is_array(SwitchYard::$handlers) and array_key_exists($hook_name,
SwitchYard::$handlers)) {
+ ksort(SwitchYard::$handlers[$hook_name], SORT_NUMERIC);
+ foreach (SwitchYard::$handlers[$hook_name] as $priority => $handlers) {
+ foreach ($handlers as $callback) call_user_func_array($callback,
$params);
+ }
}
}

=======================================
--- /framework/trunk/app/core/SwitchYard_Config.class.php Mon Jul 13
12:44:47 2009
+++ /framework/trunk/app/core/SwitchYard_Config.class.php Mon Sep 28
08:06:48 2009
@@ -38,6 +38,7 @@
$val = (string)$val;
// replace any previously-defined constants
preg_match_all('/{(.+?)}/', $val, $matches);
+ $const = array();
foreach ($matches[1] as $m) $const[$m] = constant($m);
foreach ($const as $k => $v) $val = str_replace('{'.$k.'}', $v, $val);
// read the final value into constant-space
@@ -75,13 +76,6 @@

// set the default path
self::$defaultPath = (string)self::$xml->defaultPath;
-
- // add user-specified include paths
- foreach (self::$xml->includepath->path as $path) {
- if (file_exists((string)$path)) {
- set_include_path(get_include_path().PATH_SEPARATOR.(string)$path);
- }
- }

// parse each section of the configuration file
foreach (self::$xml->section as $s) {
=======================================
--- /framework/trunk/app/core/SwitchYard_Router.class.php Thu Jul 9
08:59:53 2009
+++ /framework/trunk/app/core/SwitchYard_Router.class.php Mon Sep 28
08:06:48 2009
@@ -16,6 +16,9 @@
include SY_CNFDIR.'/routes.php';

// see if we've got a URL match
+ if (!array_key_exists('path', $_REQUEST)) {
+ $_REQUEST['path'] = '';
+ }
foreach (self::$url_match as $k => $v) {
$url_pattern = array(
'/^'.str_replace('/', '\/', $k).'$/',
@@ -45,8 +48,10 @@
$this->controller->params = $this->params;

// Set AUTH if necessary.
- define('SY_AUTH',
SwitchYard_Config::value_to_boolean(SwitchYard::$routeconfig['auth']));
- SwitchYard::doHandler('define_auth');
+ if (array_key_exists('auth', SwitchYard::$routeconfig)) {
+ define('SY_AUTH',
SwitchYard_Config::value_to_boolean(SwitchYard::$routeconfig['auth']));
+ SwitchYard::doHandler('define_auth');
+ }

}

@@ -83,6 +88,7 @@
private function _filter_input()
{
// filter input, if necessary
+ if (!array_key_exists('urlparams', SwitchYard::$routeconfig)) return;
for ($i = 0; $i < sizeof(SwitchYard::$routeconfig['urlparams']); $i++) {
$p = SwitchYard::$routeconfig['urlparams'][$i];
if (is_array($p)) {
=======================================
--- /framework/trunk/app/core/SwitchYard_View_HTML.class.php Thu Sep 10
13:55:02 2009
+++ /framework/trunk/app/core/SwitchYard_View_HTML.class.php Mon Sep 28
08:06:48 2009
@@ -92,6 +92,7 @@
$this->headers[0][] = '<meta name="'.htmlentities($name).'"
content="'.htmlentities($content).'" />';
}
ksort($this->headers, SORT_NUMERIC);
+ $output = '';
foreach ($this->headers as $priority) {
foreach ($priority as $h) {
$output .= $h;
=======================================
--- /framework/trunk/index.php Thu Sep 24 13:12:19 2009
+++ /framework/trunk/index.php Mon Sep 28 08:06:48 2009
@@ -3,12 +3,12 @@
/**
* SwitchYard Master Controller Script
* @author Jeremy Clifton <j.cl...@4-8-4.com>
- * @version 3.1.2
+ * @version 3.1.3
* @copyright 2005-2009 4-8-4 Software Works, LLC
* @license BSD
*/

-define('SY_VERSION', '3.1.2');
+define('SY_VERSION', '3.1.3');
require 'app/core/bootstrap.php';
SwitchYard::$router = new SwitchYard_Router();
SwitchYard::$router->dispatch();

Reply all
Reply to author
Forward
0 new messages