X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Fclass_BaseFrameworkSystem.php;h=dc2410c324d9991d2e8a4b91f5a4c7c791cd87e7;hb=f861d6bc00f8a3ecf6b057f2aa93129572643896;hp=57f241098e74d616981d8b538b40dca24168e1c8;hpb=c89b592250f9d2d5beaea085022aef4073349c0c;p=core.git diff --git a/framework/main/classes/class_BaseFrameworkSystem.php b/framework/main/classes/class_BaseFrameworkSystem.php index 57f24109..dc2410c3 100644 --- a/framework/main/classes/class_BaseFrameworkSystem.php +++ b/framework/main/classes/class_BaseFrameworkSystem.php @@ -194,7 +194,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac } else { // Do not call this twice trigger_error(__METHOD__ . ': Called twice.'); - exit; + exit(255); } } @@ -400,7 +400,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac * @return void */ public final function setDebugInstance (DebugMiddleware $debugInstance) { - GenericRegistry::getRegistry()->addInstance('debug', $debugInstance); + self::$debugInstance = $debugInstance; } /** @@ -543,33 +543,6 @@ Loaded includes: )); } - /** - * Output a partial stub message for the caller method - * - * @param $message An optional message to display - * @return void - */ - protected function partialStub (string $message = '') { - // Init variable - $stubMessage = 'Partial stub!'; - - // Is an extra message given? - if (!empty($message)) { - // Then add it as well - $stubMessage .= ' Message: ' . $message; - } - - // Debug instance is there? - if (!is_null($this->getDebugInstance())) { - // Output stub message - self::createDebugInstance(__CLASS__, __LINE__)->warningMessage($stubMessage); - } else { - // Trigger an error - trigger_error($stubMessage); - exit; - } - } - /** * Outputs a debug backtrace and stops further script execution * @@ -620,15 +593,12 @@ Loaded includes: // Try it try { // Get a debugger instance + //* NOISY-DEBUG: */ printf('[%s:%d]: className=%s' . PHP_EOL, __METHOD__, __LINE__, $className); self::$debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_class'), $className); } catch (NullPointerException $e) { // Didn't work, no instance there exit(sprintf('[%s:%d]: Cannot create debugInstance! Exception=%s,message=%s,className=%s,lineNumber=%d' . PHP_EOL, __METHOD__, __LINE__, $e->__toString(), $e->getMessage(), $className, $lineNumber)); } - - // Empty string should be ignored and used for testing the middleware - //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking DebugMiddleware->selfInstance->output() ...' . PHP_EOL, __METHOD__, __LINE__); - DebugMiddleware::getSelfInstance()->output(''); } // Return it @@ -844,11 +814,11 @@ Loaded includes: } else { // Trigger an error trigger_error($message . "
\n"); - exit; + exit(255); } } else { // @TODO Finish this part! - $this->partialStub('Developer mode inactive. Message:' . $message); + DebugMiddleware::getSelfInstance()->partialStub('Developer mode inactive. Message:' . $message); } }