From ce6b07f40ac1096baee8348e00f775f1f6a55b02 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 16 Aug 2006 21:11:32 +0000 Subject: [PATCH] Moving the debug function to Register --- Register.php | 21 +++++++++++++++++++++ kernel.php | 19 +------------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/Register.php b/Register.php index 5a2c872..e84889e 100644 --- a/Register.php +++ b/Register.php @@ -78,6 +78,12 @@ class BSRegister */ private $registry = array(); + /** + * An array of debug messages + * @var array + */ + private $debugInfo = array(); + // ################################################################### /** * Sets the application name @@ -255,6 +261,21 @@ class BSRegister { return $this->registry; } + + // ################################################################### + /** + * Adds a debug message to the array. This only works when debug mode + * is enabled. + * + * @param string Debug message + */ + public function debug($msg) + { + if ($this->debug) + { + $this->debugInfo[] = $msg; + } + } } /*=====================================================================*\ diff --git a/kernel.php b/kernel.php index fbe079b..4ef5497 100644 --- a/kernel.php +++ b/kernel.php @@ -108,13 +108,7 @@ class ISSO * @var string */ private $version = '[#]issoversion[#]'; - - /** - * List of all active debug messages - * @var array - */ - private $debuginfo = array(); - + /** * List of loaded modules * @var array @@ -372,17 +366,6 @@ class ISSO $this->message('Error Reporting', $table, 1); } - // ################################################################### - /** - * Logs a debug message for verbose output - * - * @param string Message - */ - public function debug($message) - { - $this->debuginfo[] = $message; - } - // ################################################################### /** * Constructs a debug information box that contains various debugging -- 2.22.5