Bootstrap update,

* Adding posibility to load any class from /workflow/engine/src/*.php
using namespaces as relative paths inside 'src' directory

* Registering /workflow/engine/src directory for autoloading

Bootstrap::registerDir('src', PATH_HOME . 'engine/src/');
This commit is contained in:
Erik Amaru Ortiz
2013-11-04 13:20:30 -04:00
parent 8ce4be68e4
commit bb3eab86d1
2 changed files with 4 additions and 4 deletions

View File

@@ -40,13 +40,13 @@ class Bootstrap
foreach (BootStrap::$includePaths as $path) {
if ($classHasNamespaceSeparator) {
$class = str_replace('\\', DIRECTORY_SEPARATOR, $class);
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, $class);
} else {
$class = str_replace('_', DIRECTORY_SEPARATOR, $class);
$classPath = str_replace('_', DIRECTORY_SEPARATOR, $class);
}
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
$classFile = $path . $class;
$classFile = $path . $classPath . '.php';
if (file_exists($classFile)) {
require_once $classFile;