projects
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e4c8bba
)
Proper way of searching for paths
author
Roland Haeder
<roland@mxchange.org>
Sat, 4 Mar 2017 21:26:54 +0000
(22:26 +0100)
committer
Roland Haeder
<roland@mxchange.org>
Sat, 4 Mar 2017 21:26:54 +0000
(22:26 +0100)
Signed-off-by: Roland Häder <roland@mxchange.org>
framework/loader/class_ClassLoader.php
patch
|
blob
|
history
diff --git
a/framework/loader/class_ClassLoader.php
b/framework/loader/class_ClassLoader.php
index f4a69ab6e6297889384d583b9811a43886dc2d40..5ef930ce25d6102f8baba52b90df27e6e76ca229 100644
(file)
--- a/
framework/loader/class_ClassLoader.php
+++ b/
framework/loader/class_ClassLoader.php
@@
-4,6
+4,7
@@
namespace CoreFramework\Loader;
// Import framework stuff
use CoreFramework\Configuration\FrameworkConfiguration;
// Import framework stuff
use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\EntryPoint\ApplicationEntryPoint;
use CoreFramework\Object\BaseFrameworkSystem;
// Import SPL stuff
use CoreFramework\Object\BaseFrameworkSystem;
// Import SPL stuff
@@
-201,13
+202,35
@@
class ClassLoader {
// Cache loader instance
$loaderInstance = self::getSelfInstance();
// Cache loader instance
$loaderInstance = self::getSelfInstance();
+ // Get config instance
+ $cfg = FrameworkConfiguration::getSelfInstance();
+
// Load all classes
foreach (self::$frameworkPaths as $shortPath) {
// Debug message
//* NOISY-DEBUG: */ printf('[%s:%d]: shortPath=%s' . PHP_EOL, __METHOD__, __LINE__, $shortPath);
// Load all classes
foreach (self::$frameworkPaths as $shortPath) {
// Debug message
//* NOISY-DEBUG: */ printf('[%s:%d]: shortPath=%s' . PHP_EOL, __METHOD__, __LINE__, $shortPath);
+ // Generate full path from it
+ $pathName = realpath(sprintf(
+ '%s/framework/main/%s/',
+ $cfg->getConfigEntry('base_path'),
+ $shortPath
+ ));
+
+ // Debug message
+ //* NOISY-DEBUG: */ printf('[%s:%d]: pathName=%s' . PHP_EOL, __METHOD__, __LINE__, $pathName);
+
+ // Is it not FALSE and accessible?
+ if (is_bool($pathName)) {
+ // Skip this
+ continue;
+ } elseif (!is_readable($pathName)) {
+ // @TODO Throw exception instead of break
+ break;
+ }
+
// Try to load the framework classes
// Try to load the framework classes
- $loaderInstance->scanClassPath(
sprintf('framework/main/%s/', $shortPath)
);
+ $loaderInstance->scanClassPath(
$pathName
);
} // END - foreach
// Trace message
} // END - foreach
// Trace message