]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/class_BaseFrameworkSystem.php
Rewrite:
[core.git] / framework / main / classes / class_BaseFrameworkSystem.php
index 1ccedc9f1726e32683bfe019de45c557eceeff08..7c6a73f92d16b56b467dce7136b54cd3719863af 100644 (file)
@@ -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);