/*=====================================================================*\
|| ###################################################################
|| # Blue Static ISSO Framework
-|| # Copyright (c)2005-2008 Blue Static
+|| # Copyright (c)2005-2009 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
\*=====================================================================*/
/**
-* ISSO Application Root (App.php)
-*
-* @package ISSO
-*/
+ * ISSO Application Root (App.php)
+ *
+ * @package ISSO
+ */
// we need PHP 5.2.0 to run
if (!function_exists('array_fill_keys'))
if ((bool)ini_get('register_globals') === true)
{
$superglobals = array('_GET', '_COOKIE', '_FILES', '_POST', '_SERVER', '_ENV');
- foreach ($superglobals AS $global)
+ foreach ($superglobals as $global)
{
if (is_array(${$global}))
{
- foreach (${$global} AS $_key => $_val)
+ foreach (${$global} as $_key => $_val)
{
if (isset(${$_key}))
{
}
}
-require_once(ISSO . '/Functions.php');
+require_once ISSO . '/ExceptionHandler.php';
+set_exception_handler(array('BSExceptionHandler', 'handle'));
/**
-* Application Class
-*
-* This is an ISSO application class. It holds all of the ISSO system variables as well
-* as serving as an object registry that is avaliable in the global scope to prevent
-* globalization of variables. There can only be one instance of this existing
-* at any given time.
-*
-* @author Blue Static
-* @copyright Copyright (c)2005 - 2008, Blue Static
-* @package ISSO
-*
-*/
+ * Application Class
+ *
+ * This is an ISSO application class. It holds all of the ISSO system variables as well
+ * as serving as an object registry that is avaliable in the global scope to prevent
+ * globalization of variables. There can only be one instance of this existing
+ * at any given time.
+ *
+ * @author Blue Static
+ * @copyright Copyright (c)2005 - 2009, Blue Static
+ * @package ISSO
+ *
+ */
class BSApp
{
/**
- * Debug mode?
- * @var bool
- */
+ * Debug mode?
+ * @var bool
+ */
private static $debug = false;
/**
- * An array of debug messages
- * @var array
- */
+ * An array of debug messages
+ * @var array
+ */
private static $debugInfo = array();
/**
private function __construct()
{}
- // ###################################################################
/**
- * Sets the debug state
- *
- * @param bool Debug mode on?
- */
+ * Sets the debug state
+ *
+ * @param bool Debug mode on?
+ */
public static function set_debug($debug)
{
self::$debug = $debug;
}
- // ###################################################################
/**
- * Gets the debug mode state
- *
- * @return bool Debug mode on?
- */
+ * Gets the debug mode state
+ *
+ * @return bool Debug mode on?
+ */
public static function get_debug()
{
return self::$debug;
}
- // ###################################################################
/**
- * Adds a debug message to the array. This only works when debug mode
- * is enabled.
- *
- * @param string Debug message
- */
+ * Adds a debug message to the array. This only works when debug mode
+ * is enabled.
+ *
+ * @param string Debug message
+ */
public static function debug($msg)
{
if (self::$debug)
}
}
- // ###################################################################
/**
- * Returns a <select> menu of all the debug notices
- *
- * @return string Debug list
- */
+ * Returns a <select> menu of all the debug notices
+ *
+ * @return string Debug list
+ */
public static function get_debug_list()
{
$output = '<select><option>Debug Notices (' . sizeof(self::$debugInfo) . ')</option>';
- foreach (self::$debugInfo AS $notice)
+ foreach (self::$debugInfo as $notice)
{
$output .= "<option>--- $notice</option>";
}