]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Fri, 24 Feb 2017 20:23:05 +0000 (21:23 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 28 Feb 2017 21:10:04 +0000 (22:10 +0100)
- scanApplicationClasses() must be called before starter.php is being included.
- this whole thing is old and needs an entire rewrite (which will take place
  slowly while this "namespace rewrite" and much more after it.
- added "import" for BaseResolver and Resolver

Signed-off-by: Roland Häder <roland@mxchange.org>
application/tests/init.php
inc/loader/class_ClassLoader.php
inc/main/classes/resolver/action/class_BaseActionResolver.php
inc/main/classes/resolver/command/class_BaseCommandResolver.php
inc/main/classes/resolver/controller/class_BaseControllerResolver.php
inc/main/interfaces/resolver/actions/class_ActionResolver.php
inc/main/interfaces/resolver/class_Resolver.php
inc/main/interfaces/resolver/commands/class_CommandResolver.php
inc/main/interfaces/resolver/controller/class_ControllerResolver.php
inc/main/interfaces/resolver/state/class_StateResolver.php
inc/selector.php

index 4c6879c6d1735c426da6905e249782ef988b9525..b877adab00baca807c763cded4126278e8bbda4d 100644 (file)
@@ -1,13 +1,11 @@
 <?php
 // Import framework stuff
 use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Loader\ClassLoader;
 
 /**
  * Application initializer
  *
- * Please remember that this include file is being loaded *before* the class
- * loader is loading classes from "exceptions", "interfaces" and "main"!
- *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
@@ -27,5 +25,8 @@ use CoreFramework\Configuration\FrameworkConfiguration;
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+// Scan for application's classes, exceptions and interfaces
+ClassLoader::scanApplicationClasses();
+
 // Get config instance
 $cfg = FrameworkConfiguration::getSelfInstance();
index 95e26bb1c05359edfcfa34e6459d5bcdc58f25f4..eee9fce15e85d458920073785c1e5ce842a64216 100644 (file)
@@ -190,11 +190,17 @@ class ClassLoader {
         * @return      void
         */
        public static function scanFrameworkClasses () {
+               // Trace message
+               /* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
+
                // Cache loader instance
                $loaderInstance = self::getSelfInstance();
 
                // Load all classes
                foreach (self::$frameworkPaths as $pathName) {
+                       // Debug message
+                       /* NOISY-DEBUG: */ printf('[%s:%d]: pathName=%s' . PHP_EOL, __METHOD__, __LINE__, $pathName);
+
                        // Try to load the framework classes
                        $loaderInstance->scanClassPath('inc/main/' . $pathName . '/');
                } // END - foreach
@@ -206,18 +212,24 @@ class ClassLoader {
         * @return      void
         */
        public static function scanApplicationClasses () {
+               // Trace message
+               /* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
+
                // Get config instance
                $cfg = FrameworkConfiguration::getSelfInstance();
 
                // Load all classes for the application
                foreach (self::$frameworkPaths as $class) {
                        // Create path name
-                       $path = sprintf('%s/%s/%s', $cfg->getConfigEntry('application_path'), $cfg->getConfigEntry('app_name'), $class);
+                       $pathName = sprintf('%s/%s/%s', $cfg->getConfigEntry('application_path'), $cfg->getConfigEntry('app_name'), $class);
+
+                       // Debug message
+                       /* NOISY-DEBUG: */ printf('[%s:%d]: pathName=%s' . PHP_EOL, __METHOD__, __LINE__, $pathName);
 
                        // Is the path readable?
-                       if (is_dir($path)) {
+                       if (is_dir($pathName)) {
                                // Try to load the application classes
-                               ClassLoader::getSelfInstance()->scanClassPath($path);
+                               ClassLoader::getSelfInstance()->scanClassPath($pathName);
                        } // END - if
                } // END - foreach
        }
index cd6cd5e9e2090532f505b2317d923cbefe0f757b..0c4841b6a04cba3c91d63ca47239c8a4c7141477 100644 (file)
@@ -4,6 +4,7 @@ namespace CoreFramework\Resolver\Action;
 
 // Import framework stuff
 use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Resolver\BaseResolver;
 
 /**
  * A generic action resolver class
index e538a8c457cba00df1b43ae39fe2d5ea08362907..730e28220a2b9e20d487303329dd53d72e9290a2 100644 (file)
@@ -5,6 +5,7 @@ namespace CoreFramework\Resolver\Controller;
 // Import framework stuff
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Request\Requestable;
+use CoreFramework\Resolver\BaseResolver;
 
 /**
  * A generic command resolver class
index 38b812401698fb26847ad8e5cf5ee38c33e029b6..13a086a8d9df44cb1fd44d4ecfd9809d256eb039 100644 (file)
@@ -4,6 +4,7 @@ namespace CoreFramework\Resolver\Controller;
 
 // Import framework stuff
 use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Resolver\BaseResolver;
 
 /**
  * A generic controller resolver class
index 7cfdccfad091d822752cb05e22c376beb0625fc5..ec97b79a76605d6088d12266d7cd4d0d84bb67b6 100644 (file)
@@ -4,6 +4,7 @@ namespace CoreFramework\Resolver\Action;
 
 // Import framework stuff
 use CoreFramework\Request\Requestable;
+use CoreFramework\Resolver\Generic\Resolver;
 
 /**
  * An instance for action resolver classes
index e06bdd4360d0b8aaa5faab254ee29eb06f025c94..437bbb861e3dfd07e874b3739d1598b513bfec25 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace CoreFramework\Resolver;
+namespace CoreFramework\Resolver\Generic;
 
 // Import framework stuff
 use CoreFramework\Generic\FrameworkInterface;
index 149fa8f20c7d3d13087e5c18df063a7a1ead5baf..71203a1f473c615aa1e99fb06c1e9eb12c1f51f2 100644 (file)
@@ -4,6 +4,7 @@ namespace CoreFramework\Resolver\Command;
 
 // Import framework stuff
 use CoreFramework\Request\Requestable;
+use CoreFramework\Resolver\Generic\Resolver;
 
 /**
  * An instance for command resolver classes
index 1bf389a69b976e813cb2b381a69edc69ab753f3b..a3c5307ac7e9e6138b558bcd17743ba64fbccbb2 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace CoreFramework\Resolver\Controller;
 
+// Import framework stuff
+use CoreFramework\Resolver\Generic\Resolver;
+
 /**
  * An instance for controller resolver classes
  *
index be7657eac600c1e0cad6f25347e918d203278a2e..d9b8707a299436754d2934c76d4fe0678637d01d 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace CoreFramework\Resolver\State;
 
+// Import framework stuff
+use CoreFramework\Resolver\Generic\Resolver;
+
 /**
  * An instance for state resolver classes
  *
index 7c8594f20a0156d08a2202be80afe0126fa4080c..59abbe55ba875d9b5d539f27de1771b3abcfd8d2 100644 (file)
@@ -81,6 +81,3 @@ unset($appInc);
 unset($configAppIncludes);
 unset($appFqFn);
 unset($basePathFile);
-
-// Scan for application's classes, exceptions and interfaces
-ClassLoader::scanApplicationClasses();