From d804728a8fec07a3c737b8aee9c388297f0209be Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 31 Oct 2016 17:50:45 +0100 Subject: php-bartlett-php-compatinfo-db: fedora autoloader --- php-bartlett-php-compatinfo-db-1.2.0-autoload.php | 17 +++++------------ php-bartlett-php-compatinfo-db-1.2.0-rpm.patch | 2 +- php-bartlett-php-compatinfo-db.spec | 9 ++++++--- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/php-bartlett-php-compatinfo-db-1.2.0-autoload.php b/php-bartlett-php-compatinfo-db-1.2.0-autoload.php index 85623cb..bb3438f 100644 --- a/php-bartlett-php-compatinfo-db-1.2.0-autoload.php +++ b/php-bartlett-php-compatinfo-db-1.2.0-autoload.php @@ -3,17 +3,10 @@ * Autoloader php-bartlett/php-compatinfo-db/php-compatinfo 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'; - } +\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\CompatInfoDb\\', __DIR__); +\Fedora\Autoloader\Dependencies::required(array( + '/usr/share/php/Composer/Semver/autoload.php', +)); - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} -$fedoraClassLoader->addPrefix('Bartlett\\CompatInfoDb\\', dirname(dirname(__DIR__))); - -require_once $vendorDir . '/Composer/Semver/autoload.php'; diff --git a/php-bartlett-php-compatinfo-db-1.2.0-rpm.patch b/php-bartlett-php-compatinfo-db-1.2.0-rpm.patch index aa5bd82..e3bbc4b 100644 --- a/php-bartlett-php-compatinfo-db-1.2.0-rpm.patch +++ b/php-bartlett-php-compatinfo-db-1.2.0-rpm.patch @@ -6,7 +6,7 @@ diff -up ./data/handleDB.php.rpm ./data/handleDB.php */ -require_once dirname(__DIR__) . '/vendor/autoload.php'; -+require_once '/usr/share/php/Symfony/autoload.php'; ++require_once '/usr/share/php/Symfony/Component/autoload.php'; +require_once dirname(__DIR__) . '/src/Bartlett/CompatInfoDb/autoload.php'; require_once __DIR__ . '/ReferenceCollection.php'; diff --git a/php-bartlett-php-compatinfo-db.spec b/php-bartlett-php-compatinfo-db.spec index fcddb32..be45815 100644 --- a/php-bartlett-php-compatinfo-db.spec +++ b/php-bartlett-php-compatinfo-db.spec @@ -24,7 +24,7 @@ Name: php-%{c_vendor}-%{c_project} Version: 1.14.0 -%global specrel 1 +%global specrel 2 Release: %{?gh_date:0.%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist} Summary: Reference Database to be used with php-compatinfo library @@ -54,7 +54,7 @@ BuildRequires: php-spl BuildRequires: php-json BuildRequires: php-pdo_sqlite # For our patch / autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) # From composer.json, "require-dev": { # "symfony/console": "~2.5", # "psr/log": "~1.0", @@ -89,7 +89,7 @@ Requires: php-spl Requires: php-json Requires: php-pdo_sqlite # Required by autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) Provides: php-composer(%{c_vendor}/%{c_project}) = %{version} # Extracted from bartlett/php-compatinfo 4 @@ -184,6 +184,9 @@ export BARTLETT_COMPATINFO_DB=%{buildroot}%{_datadir}/%{name}/compatinfo.sqlite %changelog +* Mon Oct 31 2016 Remi Collet - 1.14.0-2 +- switch to fedora/autoloader + * Sat Oct 15 2016 Remi Collet - 1.14.0-1 - update to 1.14.0 -- cgit