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:
@@ -40,13 +40,13 @@ class Bootstrap
|
|||||||
|
|
||||||
foreach (BootStrap::$includePaths as $path) {
|
foreach (BootStrap::$includePaths as $path) {
|
||||||
if ($classHasNamespaceSeparator) {
|
if ($classHasNamespaceSeparator) {
|
||||||
$class = str_replace('\\', DIRECTORY_SEPARATOR, $class);
|
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, $class);
|
||||||
} else {
|
} else {
|
||||||
$class = str_replace('_', DIRECTORY_SEPARATOR, $class);
|
$classPath = str_replace('_', DIRECTORY_SEPARATOR, $class);
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
|
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
|
||||||
$classFile = $path . $class;
|
$classFile = $path . $classPath . '.php';
|
||||||
|
|
||||||
if (file_exists($classFile)) {
|
if (file_exists($classFile)) {
|
||||||
require_once $classFile;
|
require_once $classFile;
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ try {
|
|||||||
|
|
||||||
Bootstrap::registerSystemClasses();
|
Bootstrap::registerSystemClasses();
|
||||||
|
|
||||||
Bootstrap::registerDir('BusinessModel', PATH_HOME . 'engine/BusinessModel/');
|
Bootstrap::registerDir('src', PATH_HOME . 'engine/src/');
|
||||||
|
|
||||||
require_once PATH_THIRDPARTY . '/pear/PEAR.php';
|
require_once PATH_THIRDPARTY . '/pear/PEAR.php';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user