X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=framework%2Fmain%2Fclasses%2Fclass_BaseFrameworkSystem.php;h=7c6a73f92d16b56b467dce7136b54cd3719863af;hb=3ed365cb1808ac8a228da18241e789866f419178;hp=1ccedc9f1726e32683bfe019de45c557eceeff08;hpb=efc98a00ee9fb59a995543b827ee635240308976;p=core.git diff --git a/framework/main/classes/class_BaseFrameworkSystem.php b/framework/main/classes/class_BaseFrameworkSystem.php index 1ccedc9f..7c6a73f9 100644 --- a/framework/main/classes/class_BaseFrameworkSystem.php +++ b/framework/main/classes/class_BaseFrameworkSystem.php @@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\Object; use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap; use Org\Mxchange\CoreFramework\Criteria\Criteria; use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint; -use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory; use Org\Mxchange\CoreFramework\Filesystem\PathWriteProtectedException; use Org\Mxchange\CoreFramework\Generic\FrameworkInterface; use Org\Mxchange\CoreFramework\Generic\NullPointerException; @@ -618,8 +618,11 @@ Loaded includes: * @deprecated Not fully, as the new Logger facilities are not finished yet. */ public final static function createDebugInstance (string $className, int $lineNumber = NULL) { - // Is the instance set? - if (!GenericRegistry::getRegistry()->instanceExists('debug')) { + // Validate parameter + if (empty($className)) { + // Throw IAE + throw new InvalidArgumentException('Parameter "className" is empty'); + } elseif (!GenericRegistry::getRegistry()->instanceExists('debug')) { // Init debug instance $debugInstance = NULL; @@ -629,7 +632,7 @@ Loaded includes: $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_class'), $className); } catch (NullPointerException $e) { // Didn't work, no instance there - exit(sprintf('Cannot create debugInstance! Exception=%s,message=%s,className=%s,lineNumber=%d' . PHP_EOL, $e->__toString(), $e->getMessage(), $className, $lineNumber)); + 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 @@ -1639,11 +1642,8 @@ Loaded includes: * @return void */ protected function initWebOutputInstance () { - // Get application instance - $applicationInstance = ApplicationHelper::getSelfInstance(); - // Init web output instance - $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class', array($applicationInstance)); + $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class'); // Set it locally $this->setWebOutputInstance($outputInstance);