diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-10-20 18:50:45 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-10-20 18:50:45 +0200 |
commit | 8f6d8e7d5a49a447c86927ef812d4b108ae900fe (patch) | |
tree | 62249d592a950c8691f55184bfa0dbd91bb278a2 | |
parent | d7653a0b85777e82df7f23bb6f15e8162b48adce (diff) |
php-composer-semver: switch from symfony/class-loader to fedora/autoloader
-rw-r--r-- | php-composer-semver-autoload.php | 13 | ||||
-rw-r--r-- | php-composer-semver.spec | 9 |
2 files changed, 10 insertions, 12 deletions
diff --git a/php-composer-semver-autoload.php b/php-composer-semver-autoload.php index 46fe812..e7999e6 100644 --- a/php-composer-semver-autoload.php +++ b/php-composer-semver-autoload.php @@ -2,14 +2,9 @@ /* Autoloader for composer/semver 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->addPrefix('Composer\\Semver\\', dirname(dirname(__DIR__))); +\Fedora\Autoloader\Autoload::addPsr4('Composer\\Semver\\', __DIR__); + diff --git a/php-composer-semver.spec b/php-composer-semver.spec index 8bccf93..943559b 100644 --- a/php-composer-semver.spec +++ b/php-composer-semver.spec @@ -16,7 +16,7 @@ Name: php-composer-semver Version: 1.4.2 -Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist} +Release: 2%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist} Summary: Semver library that offers utilities, version constraint parsing and validation Group: Development/Libraries @@ -41,7 +41,7 @@ BuildRequires: php-spl BuildRequires: php-composer(phpunit/phpunit) >= 4.5 BuildRequires: php-composer(phpunit/phpunit-mock-objects) >= 2.3 # Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # From composer.json, "require": { @@ -51,7 +51,7 @@ Requires: php(language) >= 5.3.2 Requires: php-pcre Requires: php-spl # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} @@ -125,6 +125,9 @@ rm -rf %{buildroot} %changelog +* Thu Sep 1 2016 Remi Collet <remi@fedoraproject.org> - 1.4.2-2 +- switch from symfony/class-loader to fedora/autoloader + * Thu Sep 1 2016 Remi Collet <remi@fedoraproject.org> - 1.4.2-1 - update to 1.4.2 |