diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-10-21 11:47:57 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-10-21 11:47:57 +0200 |
commit | 4c6fdf51f6565230396133e17ff12f94542257bf (patch) | |
tree | f93ff89ca99bf0e693866c3978c36c57009ee8c1 | |
parent | b7f1d52f58a91883e570d84196ccdd79c15a4d71 (diff) |
composer: fedora autoloader
-rw-r--r-- | composer-autoload.php | 34 | ||||
-rw-r--r-- | composer-bootstrap.php | 4 | ||||
-rw-r--r-- | composer.spec | 9 |
3 files changed, 23 insertions, 24 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', +)); diff --git a/composer-bootstrap.php b/composer-bootstrap.php index 713835a..5440159 100644 --- a/composer-bootstrap.php +++ b/composer-bootstrap.php @@ -1,4 +1,6 @@ <?php require 'Composer/autoload.php'; -$fedoraClassLoader->addPrefix('Composer\\Test\\', __DIR__); +/* \Fedora\Autoloader\Autoload::addPsr0('Composer\\Test\\', __DIR__ . '/'); broken for now */ +\Fedora\Autoloader\Autoload::addPsr4('Composer\\Test\\', __DIR__ . '/Composer/Test'); require __DIR__.'/Composer/TestCase.php'; + diff --git a/composer.spec b/composer.spec index 8cd79b1..cc3cb87 100644 --- a/composer.spec +++ b/composer.spec @@ -17,7 +17,7 @@ Name: composer Version: 1.2.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Dependency Manager for PHP Group: Development/Libraries @@ -52,7 +52,7 @@ BuildRequires: php-zip # "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" BuildRequires: php-composer(phpunit/phpunit) >= 4.5 # For autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) BuildRequires: php-seld-phar-utils >= 1.0.1 BuildRequires: php-seld-cli-prompt >= 1.0.0-3 BuildRequires: php-PsrLog >= 1.0.0-8 @@ -104,7 +104,7 @@ Requires: php-composer(symfony/filesystem) < 4 Requires: php-zip Requires: php-openssl # For our autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) Requires: php-seld-phar-utils >= 1.0.1 Requires: php-seld-cli-prompt >= 1.0.0-3 Requires: php-PsrLog >= 1.0.0-8 @@ -251,6 +251,9 @@ rm -rf %{buildroot} %changelog +* Fri Oct 21 2016 Remi Collet <remi@fedoraproject.org> - 1.2.1-2 +- switch from symfony/class-loader to fedora/autoloader + * Mon Sep 12 2016 Remi Collet <remi@fedoraproject.org> - 1.2.1-1 - update to 1.2.1 |