]>
src.bluestatic.org Git - isso.git/blob - kernel.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Blue Static ISSO Framework [#]issoversion[#]
5 || # Copyright ©2002-[#]year[#] 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 [#]gpl[#] 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 * Blue Static ISSO Framework Kernel
30 * Blue Static ISSO Framework (ISSO)
32 * This framework allows a common backend to be used amongst all Blue
33 * Static applications and is built to be abstract and flexible.
34 * The base framework handles all loading and module management.
37 * ISSO_MT_START - Define the microtime() value at the top of your
38 * script and this will calculate the total execution
40 * SVN - Place SVN $Id keyword to get SVN revision information on output
43 * @copyright Copyright ©2002 - [#]year[#], Blue Static
50 // ###################################################################
52 * Constructs a debug information box that contains various debugging
55 * @param bool Show template information?
57 * @return string Debugging block
59 public function construct_debug_block($dotemplates)
72 foreach ($this->modules
['template']->usage
AS $name => $count)
74 if (in_array($name, $this->modules
['template']->uncached
))
76 $optlist[] = $name . '[' . $count . ']';
78 $usage[] = $name . " ($count)";
81 $sizeof = sizeof($this->modules
['template']->uncached
);
84 $debug .= "\n\t<li><strong style=\"color: red\">Uncached Template(s):</strong> $sizeof ( " . implode(' ', $optlist) . " )</li>";
89 if (defined('SVN') AND preg_match('#\$Id:?\s*\$#', constant('SVN')))
91 $debug .= "\n\t<li><strong>Source Control:</strong> " . preg_replace('#\$' . 'Id: (.+?) ([0-9].+?) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(.+?) (.+?) \$#', '\\1 - SVN \\2', constant('SVN')) . "</li>";
95 if (is_object($this->modules
[ISSO_DB_LAYER
]))
97 $debug .= "\n\t<li><strong>Total Queries:</strong> " . sizeof($this->modules
[ISSO_DB_LAYER
]->history
) . " (<a href=\"" . $this->sanitize($_SERVER['REQUEST_URI']) . ((strpos($_SERVER['REQUEST_URI'], '?') !== false) ? '&query=1' : '?query=1') . "\">?</a>)</li>";
100 // total execution time
101 if (defined('ISSO_MT_START'))
103 $this->load('functions', 'functions');
104 $debug .= "\n\t<li><strong>Total Execution Time:</strong> " . round($this->modules
['functions']->fetch_microtime_diff(ISSO_MT_START
), 10) . "</li>";
108 $debug .= "\n\t<li>\n\t\t<select>\n\t\t\t<option>Debug Notices (" . sizeof($this->debuginfo
) . ")</option>";
109 foreach ((array)$this->debuginfo
AS $msg)
111 $debug .= "\n\t\t\t<option>--- $msg</option>";
113 $debug .= "\n\t\t</select>\n\t</li>";
118 $debug .= "\n\t<li>\n\t\t<select>\n\t\t\t<option>Template Usage (" . array_sum($this->modules
['template']->usage
) . ")</option>";
119 foreach ($usage AS $tpl)
121 $debug .= "\n\t\t\t<option>--- $tpl</option>";
123 $debug .= "\n\t\t</select>\n\t</li>";
128 $debug = "\n\n<!-- dev debug -->\n<div align=\"center\">\n\n<hr />\n" . $this->message('Debug Information', $debug, 1, true, false) . "\n</div>\n<!-- / dev debug -->\n\n";
135 /*=====================================================================*\
136 || ###################################################################
139 || ###################################################################
140 \*=====================================================================*/