summaryrefslogtreecommitdiffstats
path: root/composer-autoload.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-10-21 11:47:57 +0200
committerRemi Collet <fedora@famillecollet.com>2016-10-21 11:47:57 +0200
commit4c6fdf51f6565230396133e17ff12f94542257bf (patch)
treef93ff89ca99bf0e693866c3978c36c57009ee8c1 /composer-autoload.php
parentb7f1d52f58a91883e570d84196ccdd79c15a4d71 (diff)
composer: fedora autoloader
Diffstat (limited to 'composer-autoload.php')
-rw-r--r--composer-autoload.php34
1 files changed, 14 insertions, 20 deletions
diff --git a/composer-autoload.php b/composer-autoload.php
index 062bbe4..c103501 100644
--- a/composer-autoload.php
+++ b/composer-autoload.php
@@ -2,28 +2,22 @@
/* Autoloader for composer/composer and its dependencies */
$vendorDir = '/usr/share/php';
-// 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';
- }
-
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
+if (!class_exists('Fedora\\Autoloader\\Autoload', false)) {
+ require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
}
-$fedoraClassLoader->addPrefixes(array(
- 'Symfony\\Component\\' => $vendorDir,
- 'Composer\\' => dirname(__DIR__)
-));
+\Fedora\Autoloader\Autoload::addPsr4('Composer\\', __DIR__);
// Dependencies
-require_once $vendorDir . '/Seld/JsonLint/autoload.php';
-require_once $vendorDir . '/Seld/PharUtils/autoload.php';
-require_once $vendorDir . '/Seld/CliPrompt/autoload.php';
-require_once $vendorDir . '/Composer/CaBundle/autoload.php';
-require_once $vendorDir . '/Composer/Spdx/autoload.php';
-require_once $vendorDir . '/Composer/Semver/autoload.php';
-require_once $vendorDir . '/JsonSchema2/autoload.php';
-require_once $vendorDir . '/Psr/Log/autoload.php';
+\Fedora\Autoloader\Dependencies::required(array(
+ $vendorDir . '/Symfony/Component/autoload.php',
+ $vendorDir . '/Seld/JsonLint/autoload.php',
+ $vendorDir . '/Seld/PharUtils/autoload.php',
+ $vendorDir . '/Seld/CliPrompt/autoload.php',
+ $vendorDir . '/Composer/CaBundle/autoload.php',
+ $vendorDir . '/Composer/Spdx/autoload.php',
+ $vendorDir . '/Composer/Semver/autoload.php',
+ $vendorDir . '/JsonSchema2/autoload.php',
+ $vendorDir . '/Psr/Log/autoload.php',
+));