From 9e850c26ed992801f06b0726f53afaba55534387 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 21 Oct 2016 11:09:10 +0200 Subject: php-justinrainbow-json-schema; fedira-loader --- php-justinrainbow-json-schema-autoload.php | 14 +++----------- php-justinrainbow-json-schema.spec | 13 ++++++++----- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/php-justinrainbow-json-schema-autoload.php b/php-justinrainbow-json-schema-autoload.php index 24540d8..b2dca24 100644 --- a/php-justinrainbow-json-schema-autoload.php +++ b/php-justinrainbow-json-schema-autoload.php @@ -3,17 +3,9 @@ * Autoloader for justinrainbow/json-schema and its dependencies */ -$vendorDir = '/usr/share/php'; - -// Use Symfony PSR4 autoloader -if (!isset($fedoraPsr4ClassLoader) || !($fedoraPsr4ClassLoader instanceof \Symfony\Component\ClassLoader\Psr4ClassLoader)) { - if (!class_exists('Symfony\\Component\\ClassLoader\\Psr4ClassLoader', false)) { - require_once '/usr/share/php/Symfony/Component/ClassLoader/Psr4ClassLoader.php'; - } - - $fedoraPsr4ClassLoader = new \Symfony\Component\ClassLoader\Psr4ClassLoader(); - $fedoraPsr4ClassLoader->register(true); +if (!class_exists('Fedora\\Autoloader\\Autoload', false)) { + require_once '/usr/share/php/Fedora/Autoloader/autoload.php'; } -$fedoraPsr4ClassLoader->addPrefix('JsonSchema\\', __DIR__); +\Fedora\Autoloader\Autoload::addPsr4('JsonSchema\\', __DIR__); diff --git a/php-justinrainbow-json-schema.spec b/php-justinrainbow-json-schema.spec index b34c121..5127529 100644 --- a/php-justinrainbow-json-schema.spec +++ b/php-justinrainbow-json-schema.spec @@ -30,7 +30,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 2.0.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A library to validate a json schema Group: Development/Libraries @@ -65,7 +65,7 @@ BuildRequires: php-spl # "phpdocumentor/phpdocumentor": "~2" BuildRequires: php-composer(phpunit/phpunit) >= 4.8.22 # Autoloader -BuildRequires: php-composer(symfony/class-loader) >= 2.5 +BuildRequires: php-composer(fedora/autoloader) # For composer schema BuildRequires: composer %endif @@ -81,8 +81,8 @@ Requires: php-json Requires: php-mbstring Requires: php-pcre Requires: php-spl -# Autoloader (2.5 for PSR-4) -Requires: php-composer(symfony/class-loader) >= 2.5 +# Autoloader +Requires: php-composer(fedora/autoloader) %if %{eolv1} Obsoletes: php-JsonSchema < 2 %endif @@ -158,7 +158,7 @@ install -Dpm 0755 bin/validate-json %{buildroot}%{_bindir}/validate-json cat << 'EOF' | tee vendor/autoload.php addPrefix('JsonSchema\\Tests\\', 'tests/'); +\Fedora\Autoloader\Autoload::addPsr4('JsonSchema\\Tests\\', 'tests/'); EOF : Test the command @@ -209,6 +209,9 @@ rm -rf %{buildroot} %changelog +* Fri Oct 21 2016 Remi Collet - 2.0.5-3 +- switch from symfony/class-loader to fedora/autoloader + * Thu Jul 21 2016 Remi Collet - 2.0.5-2 - fix failed test, FTBFS detected by Koschei open https://github.com/justinrainbow/json-schema/pull/292 -- cgit