]> git.mxchange.org Git - shipsimu.git/commitdiff
Deug backtraces centralized
authorRoland Häder <roland@mxchange.org>
Fri, 20 Jun 2008 18:04:22 +0000 (18:04 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 20 Jun 2008 18:04:22 +0000 (18:04 +0000)
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/commands/web/class_WebDoFormCommand.php
inc/classes/main/controller/default/class_WebDefaultNewsController.php
inc/classes/main/controller/default/class_WebLoginController.php
inc/classes/main/controller/form/class_WebDoFormController.php
inc/classes/main/controller/login/class_WebLoginAreaController.php
inc/classes/main/debug/class_DebugConsoleOutput.php
inc/classes/main/output/class_WebOutput.php
inc/classes/main/resolver/class_BaseResolver.php
inc/classes/main/resolver/web/class_WebControllerResolver.php
inc/loader/class_ClassLoader.php

index 9432fa656ccb117cc29bf1dd6c58e01a308da587..b725a85658143712d8edd560802c46ff2aad221b 100644 (file)
@@ -894,7 +894,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                );
 
                // Output it
-               ApplicationEntryPoint::app_die(sprintf("<strong>%s debug output:</strong>%s", $this->__toString(), $content));
+               ApplicationEntryPoint::app_die(sprintf("<strong>%s debug output:</strong><div id=\"debug_content\">%s</div>Loaded includes: <div id=\"debug_include_list\">%s</div>",
+                       $this->__toString(),
+                       $content,
+                       ClassLoader::getInstance()->getPrintableIncludeList()
+               ));
        }
 
        /**
index 79f292a7a76dda6b3543a0020c86122af45969cd..dfd7b2cfc7ec4933058d8991fb50ead099435cd9 100644 (file)
@@ -67,9 +67,7 @@ class WebDoFormCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Should never be executed...
-               echo "<strong>This should never be executed!</strong><pre>";
-               debug_print_backtrace();
-               die("</pre>Good bye...");
+               $this->debugBacktrace();
        }
 
        /**
index fee2d39f00034c55f50e7b8828cfb8173245b919..f623f8407e997da0915036278b2af8e99160358b 100644 (file)
@@ -67,6 +67,9 @@ class WebDefaultNewsController extends BaseController implements Controller {
         * @return      void
         */
        public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this);
+
                // Run the pre filters
                $this->executePreFilters($requestInstance, $responseInstance);
 
index 5c8f9f4214e1e09bd9db22eaf5eea52d09349e77..28378f393c13e9622cafb462176f27bdcdceede5 100644 (file)
@@ -66,6 +66,9 @@ class WebLoginController extends BaseController implements Controller {
         * @return      void
         */
        public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this);
+
                // Run the pre filters
                $this->executePreFilters($requestInstance, $responseInstance);
 
index 1856dd3d1718f38babda4f23a2baf592c33d0433..42171a600a2618f2049446ec0652104f1af0f6ff 100644 (file)
@@ -72,7 +72,7 @@ class WebDoFormController extends BaseController implements Controller {
                // Get command instance from resolver
                $commandInstance = $this->getResolverInstance()->resolveCommand($formAction);
 
-               // Try to add more filters by the command
+               // Add more filters by the command
                $commandInstance->addExtraFilters($this);
 
                // Try to run the pre filters, if auth exceptions come through redirect here
index 7ea4e50d5e77b21e01273de534e40aab913c0c8d..c43c897d2874e98d65b982d0bc9c5263c9d1a196 100644 (file)
@@ -77,6 +77,9 @@ class WebLoginAreaController extends BaseController implements Controller {
         * @return      void
         */
        public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this);
+
                // Try to run the pre filters, if auth exceptions come through redirect here
                try {
                        // Run the pre filters
index be17ae39adbfde9ab0749a20a304cc16c9b2c9f6..9f5690325256cb5a139be2040ac056e87fe14c9d 100644 (file)
@@ -58,7 +58,7 @@ class DebugConsoleOutput extends BaseFrameworkSystem implements Debugger, Output
         * @return      void
         */
        public final function outputStream ($output) {
-               print html_entity_decode(strip_tags($output));
+               print(html_entity_decode(strip_tags($output)));
        }
 
        /**
index 5b4f58838d6f9f1b842ee71e00e9fb59c8738341..0b21ff30a964ac29e924a484ff572ca57f6c4ec1 100644 (file)
@@ -90,7 +90,7 @@ class WebOutput extends BaseFrameworkSystem implements OutputStreamer, Registera
         * @return      void
         */
        public final function output ($outStream=false) {
-               print $outStream;
+               print($outStream);
        }
 }
 
index 9345109a8ac24b99b46e841dc6daf41cd6cd7f60..6c9ebf724660db5e531d7954eb3f41048fafc44f 100644 (file)
@@ -129,11 +129,7 @@ class BaseResolver extends BaseFrameworkSystem {
                }
 
                // Debug output
-               //echo "<strong>----- ".__METHOD__." -----</strong><br />\n";
-               //print($class."<pre>");
-               //debug_print_backtrace();
-               //var_dump($isValid);
-               //print("</pre>");
+               //* DEBUG: */ $this->debugBacktrace();
 
                // Set command name
                $this->setCommandName($commandName);
index 1debf14ae63cd83d2df6ccab8e135ed2db13eed3..a02eeaac15d2f42145d52d26a68eabca498d0c01 100644 (file)
@@ -132,10 +132,7 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver {
         */
        private function loadController ($commandName) {
                 // Debug message
-                //print("<strong>----- ".__METHOD__." -----</strong><pre>");
-                //debug_print_backtrace();
-                //print("</pre>");
-                //
+                //* DEBUG: */ $this->debugBacktrace();
 
                // Cache default command
                $defaultCommand = $this->getConfigInstance()->readConfig('default_command');
index 06b8fd82c07e666f9d9e63aecd22e9c2958ed738..5f0f2b97f41cedc1448e08036291ce60536a482b 100644 (file)
@@ -314,11 +314,11 @@ class ClassLoader {
                        // Count this include
                        $this->total++;
 
+                       // Mark this class as loaded
+                       $this->loadedClasses[] = $this->classes[$fileName];
+
                        // Developer mode excludes caching (better debugging)
                        if (!defined('DEVELOPER')) {
-                               // Mark this class as loaded
-                               $this->loadedClasses[] = $this->classes[$fileName];
-
                                // Reset cache
                                $this->classesCached = false;
                        } // END - if
@@ -352,6 +352,22 @@ class ClassLoader {
        public final function getTotal () {
                return $this->total;
        }
+
+       /**
+        * Getter for a printable list of included classes/interfaces/exceptions
+        *
+        * @param       $includeList    A printable include list
+        */
+       public function getPrintableIncludeList () {
+               // Prepare the list
+               $includeList = "";
+               foreach ($this->loadedClasses as $classFile) {
+                       $includeList .= basename($classFile)."<br />\n";
+               } // END - foreach
+
+               // And return it
+               return $includeList;
+       }
 }
 
 // [EOF]