]>
src.bluestatic.org Git - isso.git/blob - App.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Blue Static ISSO Framework
5 || # Copyright (c)2005-2008 Blue Static
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version 2 of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
23 * ISSO Application Root (App.php)
28 // we need PHP 5.2.0 to run
29 if (!function_exists('array_fill_keys'))
31 print('You need PHP version 5.2.0 or newer to run ISSO');
35 // get rid of register_globals
36 if ((bool)ini_get('register_globals') === true)
38 $superglobals = array('_GET', '_COOKIE', '_FILES', '_POST', '_SERVER', '_ENV');
39 foreach ($superglobals as $global)
41 if (is_array(${$global}))
43 foreach (${$global} as $_key => $_val)
54 require_once ISSO
. '/ExceptionHandler.php';
55 set_exception_handler(array('BSExceptionHandler', 'handle'));
60 * This is an ISSO application class. It holds all of the ISSO system variables as well
61 * as serving as an object registry that is avaliable in the global scope to prevent
62 * globalization of variables. There can only be one instance of this existing
66 * @copyright Copyright (c)2005 - 2008, Blue Static
76 private static $debug = false;
79 * An array of debug messages
82 private static $debugInfo = array();
87 private function __construct()
91 * Sets the debug state
93 * @param bool Debug mode on?
95 public static function set_debug($debug)
97 self
::$debug = $debug;
101 * Gets the debug mode state
103 * @return bool Debug mode on?
105 public static function get_debug()
111 * Adds a debug message to the array. This only works when debug mode
114 * @param string Debug message
116 public static function debug($msg)
120 self
::$debugInfo[] = $msg;
125 * Returns a <select> menu of all the debug notices
127 * @return string Debug list
129 public static function get_debug_list()
131 $output = '<select><option>Debug Notices (' . sizeof(self
::$debugInfo) . ')</option>';
132 foreach (self
::$debugInfo as $notice)
134 $output .= "<option>--- $notice</option>";
136 return "$output</select>";
139 // ###################################################################
158 public static $input;
164 public static $template;