summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Jones2011-11-07 21:36:37 (GMT)
committerSteven Jones2011-11-07 21:36:48 (GMT)
commitf837baa70dbe12655b65ec86286962bbb81ecf8e (patch)
treec7c63e5b69cb2512bd35884ed4f653887c95b4a6
parentb4b2d377f81b9f3ec7d7125edc1580242b537893 (diff)
Issue #1333710 by Steven Jones: Fixed Autoloader doesn't work in PHP 5.2.dev/1318374-autoloader
-rw-r--r--Symfony/Component/ClassLoader/UniversalClassLoader.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/Symfony/Component/ClassLoader/UniversalClassLoader.php b/Symfony/Component/ClassLoader/UniversalClassLoader.php
index d5f93c8..148aa05 100644
--- a/Symfony/Component/ClassLoader/UniversalClassLoader.php
+++ b/Symfony/Component/ClassLoader/UniversalClassLoader.php
@@ -189,7 +189,14 @@ class UniversalClassLoader
*/
public function register($prepend = false)
{
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+ // We need a special call to the autoloader for PHP 5.2, missing the
+ // third parameter.
+ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+ spl_autoload_register(array($this, 'loadClass'), true);
+ }
+ else {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+ }
}
/**