diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-10-29 14:59:09 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-10-29 14:59:09 +0200 |
commit | 1010a7dbfb1edf99e56d2f402d7d15d094944048 (patch) | |
tree | e4903fb7548086e9c0d078711928f27605aac1dc | |
parent | 36e2275711f557fea2a9948afb7ccc0404916b00 (diff) |
php-sabre-xml: switch from symfony/class-loader to fedora/autoloader
-rw-r--r-- | php-sabre-xml-autoload.php | 20 | ||||
-rw-r--r-- | php-sabre-xml.spec | 13 |
2 files changed, 11 insertions, 22 deletions
diff --git a/php-sabre-xml-autoload.php b/php-sabre-xml-autoload.php index d8eeb00..c50ba4e 100644 --- a/php-sabre-xml-autoload.php +++ b/php-sabre-xml-autoload.php @@ -1,26 +1,14 @@ <?php -/** - * Autoloader for sabre/xml and its dependencies - */ +/* Autoloader for sabre/xml and its dependencies */ -$vendorDir = '/usr/share/php'; +require_once '/usr/share/php/Fedora/Autoloader/autoload.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(); -} - -$fedoraClassLoader->addPrefix('Sabre\\Xml\\', dirname(dirname(__DIR__))); +\Fedora\Autoloader\Autoload::addPsr4('Sabre\\Xml\\', __DIR__); // Functions require_once __DIR__ . '/Deserializer/functions.php'; require_once __DIR__ . '/Serializer/functions.php'; // Dependencies -require_once $vendorDir . '/Sabre/Uri/autoload.php'; +require_once '/usr/share/php/Sabre/Uri/autoload.php'; diff --git a/php-sabre-xml.spec b/php-sabre-xml.spec index 7d4e278..9f120a0 100644 --- a/php-sabre-xml.spec +++ b/php-sabre-xml.spec @@ -20,7 +20,7 @@ Name: php-%{gh_project} Summary: XML library that you may not hate Version: 1.5.0 -Release: 1%{?dist} +Release: 2%{?dist} URL: https://github.com/%{gh_owner}/%{gh_project} License: BSD @@ -43,7 +43,7 @@ BuildRequires: php-spl # "phpunit/phpunit" : "*" BuildRequires: php-composer(phpunit/phpunit) # Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # From composer.json, "require" : { @@ -63,7 +63,7 @@ Requires: php-composer(sabre/uri) < 3 Requires: php-pcre Requires: php-spl # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) Provides: php-composer(sabre/xml) = %{version} @@ -100,9 +100,7 @@ cat << 'EOF' | tee vendor/autoload.php require_once '%{buildroot}%{_datadir}/php/Sabre/Xml/autoload.php'; // Tests require_once '%{_datadir}/php/Symfony/Component/ClassLoader/Psr4ClassLoader.php'; -$fedoraPsr4ClassLoader = new \Symfony\Component\ClassLoader\Psr4ClassLoader(); -$fedoraPsr4ClassLoader->register(true); -$fedoraPsr4ClassLoader->addPrefix('Sabre\\Xml\\', dirname(__DIR__).'/tests/Sabre/Xml/'); +\Fedora\Autoloader\Autoload::addPsr4('Sabre\\Xml\\', dirname(__DIR__).'/tests/Sabre/Xml/'); EOF cd tests @@ -142,6 +140,9 @@ rm -rf %{buildroot} %changelog +* Sat Oct 29 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-2 +- switch from symfony/class-loader to fedora/autoloader + * Mon Oct 10 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-1 - update to 1.5.0 - raise dependency on PHP 5.5 |