X-Git-Url: https://git.mxchange.org/?p=hub.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmiddleware%2Fdebug%2Fclass_DebugMiddleware.php;fp=inc%2Fclasses%2Fmiddleware%2Fdebug%2Fclass_DebugMiddleware.php;h=0000000000000000000000000000000000000000;hp=8ee7e08375efffb416b7efe98c3d13ea235b8134;hb=7150c6d1a1e3c91d3cfd2e732b26bbe9f0dc4f57;hpb=12dbc1af8f0bc2981711b17c7c955f270c440b35 diff --git a/inc/classes/middleware/debug/class_DebugMiddleware.php b/inc/classes/middleware/debug/class_DebugMiddleware.php deleted file mode 100644 index 8ee7e0837..000000000 --- a/inc/classes/middleware/debug/class_DebugMiddleware.php +++ /dev/null @@ -1,119 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * 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 . - */ -class DebugMiddleware extends BaseMiddleware implements Registerable { - /** - * The concrete output instance - */ - private $outputInstance = null; - - /** - * An instance of this class - */ - private static $thisInstance = null; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - - // Set own instance - self::$thisInstance = $this; - } - - /** - * Create a new debug output system. - * If no output is given this class is currently being used for back-fall. - * This fall-back mechanism will become deprecated very soon. - * - * @param $debuggerClass The class name which we shall use for - * registering the *real* debug output - * @return $debugInstance An instance of this middleware class - */ - public final static function createDebugMiddleware ($debuggerClass) { - // Create an instance if this middleware - $debugInstance = new DebugMiddleware(); - - // Is there a valid output instance provided? - if ((!is_null($debuggerClass)) && (is_object($debuggerClass)) && ($debuggerClass instanceof OutputStreamer)) { - // Use the given output instance - $debugInstance->setOutputInstance($debuggerClass); - } elseif ((!is_null($debuggerClass)) && (is_string($debuggerClass)) && (class_exists($debuggerClass))) { - // A name for a debug output class has been provided so we try to get it - $debuggerInstance = ObjectFactory::createObjectByName($debuggerClass); - - // Set this as output class - $debugInstance->setOutputInstance($debuggerInstance); - } - - // Return instance - return $debugInstance; - } - - /** - * Getter for an instance of this class - * - * @return $thisInstance An instance of this class - */ - public final static function getInstance() { - return self::$thisInstance; - } - - /** - * Setter for output instance - * - * @param $outputInstance The debug output instance - * @return void - */ - public final function setOutputInstance (OutputStreamer $outputInstance) { - $this->outputInstance = $outputInstance; - } - - /** - * This method shall send debug output which can be HTML code for the - * browser or debug lines for a log file, etc. to the registered debug - * output instance. - * - * @param $outStream Data we shall "stream" out to the world - * @return void - */ - public final function output ($outStream) { - // Is the output stream set - if (empty($outStream)) { - // Initialization phase - return; - } // END - if - - // Use the output instance - $this->outputInstance->outputStream($outStream); - } -} - -// [EOF] -?>