Separate web and console debugging.
authorRoland Haeder <roland@mxchange.org>
Tue, 24 Mar 2015 17:29:01 +0000 (18:29 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 24 Mar 2015 17:29:01 +0000 (18:29 +0100)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
application/tests/init.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/config.php
inc/output.php [deleted file]

index 6b62980..7bb8a3a 100644 (file)
@@ -27,9 +27,6 @@
 // Get config instance
 $cfg = FrameworkConfiguration::getSelfInstance();
 
-// Initialize output system
-require($cfg->getConfigEntry('base_path') . 'inc/output.php');
-
 // This application needs a database connection then we have to simply include
 // the inc/database.php script
 require($cfg->getConfigEntry('base_path') . 'inc/database.php');
index cfba6f1..e1f0d55 100644 (file)
@@ -1670,7 +1670,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // Try it
                        try {
                                // Get a debugger instance
-                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_class'));
+                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_' . $this->getResponseTypeFromSystem() . '_class'));
                        } catch (NullPointerException $e) {
                                // Didn't work, no instance there
                                exit('Cannot create debugInstance! Exception=' . $e->__toString() . ', message=' . $e->getMessage());
index 8df6b65..210eab3 100644 (file)
@@ -95,8 +95,11 @@ $cfg->setConfigEntry('html_template_class', 'HtmlTemplateEngine');
 // CFG: DECO-XML-REWRITER-TEMPLATE-CLASS
 $cfg->setConfigEntry('deco_xml_rewriter_template_class', 'XmlRewriterTemplateDecorator');
 
-// CFG: DEBUG-CLASS
-$cfg->setConfigEntry('debug_class', 'DebugWebOutput');
+// CFG: DEBUG-WEB-CLASS
+$cfg->setConfigEntry('debug_web_class', 'DebugWebOutput');
+
+// CFG: DEBUG-CONSOLE-CLASS
+$cfg->setConfigEntry('debug_console_class', 'DebugConsoleOutput');
 
 // CFG: DEFAULT-LANGUAGE
 $cfg->setConfigEntry('default_lang', 'de'); // A two-char language string: de for german, en for english and so on
diff --git a/inc/output.php b/inc/output.php
deleted file mode 100644 (file)
index 59c3994..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * Initializes the output middleware layer
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- * @deprecated
- * @todo               Minimize these includes
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-// Get a debugger instance
-$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_class'));
-
-// Empty string should be ignored and used for testing the middleware
-DebugMiddleware::getSelfInstance()->output('');
-
-// [EOF]
-?>