Hi,
I was just looking at the universal class loader and I began to wonder if the
fallback's in both cases shouldn't best be handled via include path magic as it
seems at this point we are just blindly prefixing a fixed path with a list of
dir's.
diff --git a/src/Symfony/Component/ClassLoader/UniversalClassLoader.php
b/src/Symfony/Component/ClassLoader/UniversalClassLoader.php
index 0394fa4..7bf01ef 100644
--- a/src/Symfony/Component/ClassLoader/UniversalClassLoader.php
+++ b/src/Symfony/Component/ClassLoader/UniversalClassLoader.php
@@ -200,13 +200,7 @@ class UniversalClassLoader
}
}
- foreach ($this->namespaceFallback as $dir) {
- $file = $dir.DIRECTORY_SEPARATOR.str_replace('\\',
DIRECTORY_SEPARATOR, $class).'.php';
- if (file_exists($file)) {
- require $file;
- return;
- }
- }
+ $file = str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
} else {
// PEAR-like class name
foreach ($this->prefixes as $prefix => $dirs) {
@@ -221,13 +215,12 @@ class UniversalClassLoader
}
}
- foreach ($this->prefixFallback as $dir) {
- $file = $dir.DIRECTORY_SEPARATOR.str_replace('_',
DIRECTORY_SEPARATOR, $class).'.php';
- if (file_exists($file)) {
- require $file;
- return;
- }
- }
+ $file = str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
+ }
+
+ $file = stream_resolve_include_path($file);
+ if ($file) {
+ require $file;
}
}
}
Gruss,
Lukas Kahwe Smith
[email protected]
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en