diff options
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(); |