- 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>
<?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
* 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();
* @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
* @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
}
// Import framework stuff
use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Resolver\BaseResolver;
/**
* A generic action resolver class
// Import framework stuff
use CoreFramework\Factory\ObjectFactory;
use CoreFramework\Request\Requestable;
+use CoreFramework\Resolver\BaseResolver;
/**
* A generic command resolver class
// Import framework stuff
use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Resolver\BaseResolver;
/**
* A generic controller resolver class
// Import framework stuff
use CoreFramework\Request\Requestable;
+use CoreFramework\Resolver\Generic\Resolver;
/**
* An instance for action resolver classes
<?php
// Own namespace
-namespace CoreFramework\Resolver;
+namespace CoreFramework\Resolver\Generic;
// Import framework stuff
use CoreFramework\Generic\FrameworkInterface;
// Import framework stuff
use CoreFramework\Request\Requestable;
+use CoreFramework\Resolver\Generic\Resolver;
/**
* An instance for command resolver classes
// Own namespace
namespace CoreFramework\Resolver\Controller;
+// Import framework stuff
+use CoreFramework\Resolver\Generic\Resolver;
+
/**
* An instance for controller resolver classes
*
// Own namespace
namespace CoreFramework\Resolver\State;
+// Import framework stuff
+use CoreFramework\Resolver\Generic\Resolver;
+
/**
* An instance for state resolver classes
*
unset($configAppIncludes);
unset($appFqFn);
unset($basePathFile);
-
-// Scan for application's classes, exceptions and interfaces
-ClassLoader::scanApplicationClasses();