$_val)
{
if (isset(${$_key}))
{
unset(${$_key});
}
}
}
}
}
/**
* Yes, required
*/
define('REQ_YES', 1);
/**
* No, not required
*/
define('REQ_NO', 0);
/**
* Blue Static ISSO Framework (ISSO)
*
* This framework allows a common backend to be used amongst all Blue
* Static applications and is built to be abstract and flexible.
* The base framework handles all loading and module management.
*
* Constants:
* ISSO_MT_START - Define the microtime() value at the top of your
* script and this will calculate the total execution
* time
* SVN - Place SVN keywords (like $Id) to display the information on output
*
* @author Blue Static
* @copyright Copyright ©2002 - [#]year[#], Blue Static
* @version $Revision$
* @package ISSO
*
*/
class ISSO
{
/**
* ISSO version
* @var string
*/
private $version = '[#]issoversion[#]';
/**
* List of loaded modules
* @var array
*/
private $modules = array();
// ###################################################################
/**
* Prints a list of all currently loaded framework modules
*
* @param bool Return the data as an array?
*
* @return mixed HTML output or an array of loaded modules
*/
public function show_modules($return = false)
{
$modules = array();
foreach ($this->modules AS $object)
{
$module = get_class($object);
if (method_exists($object, 'init_as_package') AND in_array($module, $modules))
{
$module = $object->init_as_package() . " - ($module)";
}
$modules[] = $module;
}
if ($return)
{
return $modules;
}
else
{
$output = "\n\n
\n\t- ";
$output .= implode("
\n\t- ", $modules);
$output .= "
\n
\n\n";
$this->message('Loaded Modules', $output, 1);
}
}
// ###################################################################
/**
* Constructs a debug information box that contains various debugging
* information points
*
* @param bool Show template information?
*
* @return string Debugging block
*/
public function construct_debug_block($dotemplates)
{
$debug = '';
if ($this->debug)
{
$debug = "\n";
// templates
if ($dotemplates)
{
$optlist = array();
$usage = array();
foreach ($this->modules['template']->usage AS $name => $count)
{
if (in_array($name, $this->modules['template']->uncached))
{
$optlist[] = $name . '[' . $count . ']';
}
$usage[] = $name . " ($count)";
}
$sizeof = sizeof($this->modules['template']->uncached);
if ($sizeof > 0)
{
$debug .= "\n\t- Uncached Template(s): $sizeof ( " . implode(' ', $optlist) . " )
";
}
}
// source control
$scinfo = 'Not Under Source Control';
if (defined('SVN'))
{
$scinfo = constant('SVN');
if (preg_match('#\$Id:?\s*\$#', $scinfo))
{
$scinfo = 'Not Under Source Control';
}
else
{
$scinfo = preg_replace('#\$' . '(Head)?URL: (.+?) \$#e', "end(explode('/', '\\2'))", $scinfo);
$scinfo = preg_replace('#\$' . '(LastModified)?Revision: (.+?) \$#', 'SVN \\2', $scinfo);
$scinfo = 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', $scinfo);
}
}
$scinfo = trim($scinfo);
$debug .= "\n\t- Source Control: $scinfo
";
// query information
if (is_object($this->modules[ISSO_DB_LAYER]))
{
$debug .= "\n\t- Total Queries: " . sizeof($this->modules[ISSO_DB_LAYER]->history) . " (sanitize($_SERVER['REQUEST_URI']) . ((strpos($_SERVER['REQUEST_URI'], '?') !== false) ? '&query=1' : '?query=1') . "\">?)
";
}
// total execution time
if (defined('ISSO_MT_START'))
{
$this->load('functions', 'functions');
$debug .= "\n\t- Total Execution Time: " . round($this->modules['functions']->fetch_microtime_diff(ISSO_MT_START), 10) . "
";
}
// debug notices
$debug .= "\n\t- \n\t\t\n\t
";
// loaded modules
$modules = $this->show_modules(true);
$debug .= "\n\t- \n\t\t\n\t
";
// template usage
if ($dotemplates)
{
$debug .= "\n\t- \n\t\t\n\t
";
}
$debug .= "\n
";
$debug = "\n\n\n\n\n
\n" . $this->message('Debug Information', $debug, 1, true, false) . "\n\n\n\n";
}
return $debug;
}
}
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
|| # $Id$
|| ###################################################################
\*=====================================================================*/
?>