From: Roland Haeder Date: Tue, 24 Mar 2015 17:29:01 +0000 (+0100) Subject: Separate web and console debugging. X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=fbd656cb3ca44cd60893ad06983c43d908ad1e29 Separate web and console debugging. Signed-off-by: Roland Häder --- diff --git a/application/tests/init.php b/application/tests/init.php index 6b629808..7bb8a3a6 100644 --- a/application/tests/init.php +++ b/application/tests/init.php @@ -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'); diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index cfba6f1f..e1f0d55f 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -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()); diff --git a/inc/config.php b/inc/config.php index 8df6b657..210eab3d 100644 --- a/inc/config.php +++ b/inc/config.php @@ -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 index 59c3994e..00000000 --- a/inc/output.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @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 . - */ - -// 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] -?>