diff options
author | Remi Collet <fedora@famillecollet.com> | 2014-08-11 13:22:09 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2014-08-11 13:22:09 +0200 |
commit | 48c738779b51f4cb1367859659ab34c8d1e4e927 (patch) | |
tree | 54bc4efecf61aad60140e316402b7b0d744d8354 /Autoload.php.in | |
parent | ef903504bb23bd2afb71219d4e572db03b526e68 (diff) |
php-phpunit-PHPUnit: 4.2.0
Diffstat (limited to 'Autoload.php.in')
-rw-r--r-- | Autoload.php.in | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/Autoload.php.in b/Autoload.php.in index 5077fd4..5b6b946 100644 --- a/Autoload.php.in +++ b/Autoload.php.in @@ -14,6 +14,19 @@ require_once 'SebastianBergmann/Exporter/autoload.php'; require_once 'SebastianBergmann/Version/autoload.php'; require_once 'SebastianBergmann/Comparator/autoload.php'; +$vendorDir = '/usr/share/php'; +require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php'; +use Symfony\Component\ClassLoader\UniversalClassLoader; + +$loader = new UniversalClassLoader(); +$loader->registerNamespaces(array( + 'Symfony\\Component\\Yaml' => $vendorDir, + 'Symfony\\Component\\ClassLoader' => $vendorDir, + 'LazyMap' => $vendorDir, + 'Instantiator' => $vendorDir, +)); +$loader->register(); + spl_autoload_register( function ($class) { @@ -36,26 +49,6 @@ spl_autoload_register( } ); -// Symfony Yaml autoloader -spl_autoload_register( - function ($class) { - if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Yaml')) { - $file = sprintf( - 'Symfony/Component/Yaml%s.php', - - substr( - str_replace('\\', '/', $class), - strlen('Symfony\Component\Yaml') - ) - ); - - if (stream_resolve_include_path($file)) { - require_once $file; - } - } - } -); - /* Optional */ if (stream_resolve_include_path('PHPUnit/Extensions/Database/Autoload.php')) { |