diff options
author | Remi Collet <fedora@famillecollet.com> | 2015-06-29 08:38:53 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2015-06-29 08:38:53 +0200 |
commit | adee2b6f31f4dc66bceff18a5d5fae0e970ebea5 (patch) | |
tree | 7bd1b92bed078c5244dd996604d99d44f8ebeef2 /composer-autoload.php | |
parent | b00c9837f45670629c57be4d2f48622283add76f (diff) |
composer: new snapshot + review autloader
Diffstat (limited to 'composer-autoload.php')
-rw-r--r-- | composer-autoload.php | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/composer-autoload.php b/composer-autoload.php index 11b8043..65c331f 100644 --- a/composer-autoload.php +++ b/composer-autoload.php @@ -1,18 +1,21 @@ <?php $vendorDir = '/usr/share/php'; -require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php'; -use Symfony\Component\ClassLoader\UniversalClassLoader; +// Use Symfony autoloader +if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { + if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { + require_once $vendorDir . '/Symfony/Component/ClassLoader/ClassLoader.php'; + } -$loader = new UniversalClassLoader(); -$loader->registerNamespaces(array( - 'Seld\\JsonLint' => $vendorDir, - 'Seld\\PharUtils' => $vendorDir, - 'Seld\\CliPrompt' => $vendorDir, - 'JsonSchema' => $vendorDir, - 'Symfony\\Component\\Console' => $vendorDir, - 'Symfony\\Component\\Finder' => $vendorDir, - 'Symfony\\Component\\Process' => $vendorDir, - 'Symfony\\Component\\ClassLoader' => $vendorDir, - 'Composer' => dirname(__DIR__) + $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); + $fedoraClassLoader->register(); +} + +$fedoraClassLoader->addPrefixes(array( + 'Seld\\JsonLint\\' => $vendorDir, + 'Seld\\PharUtils\\' => $vendorDir, + 'Seld\\CliPrompt\\' => $vendorDir, + 'JsonSchema\\' => $vendorDir, + 'Symfony\\Component\\' => $vendorDir, + 'Composer\\' => dirname(__DIR__) )); -$loader->register(); +$fedoraClassLoader->register(); |