summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-jsonlint-autoload.php14
-rw-r--r--php-jsonlint.spec9
2 files changed, 10 insertions, 13 deletions
diff --git a/php-jsonlint-autoload.php b/php-jsonlint-autoload.php
index 53f50f4..a6c272d 100644
--- a/php-jsonlint-autoload.php
+++ b/php-jsonlint-autoload.php
@@ -1,15 +1,9 @@
<?php
/* Autoloader for seld/jsonlint 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('Seld\\JsonLint\\', dirname(dirname(__DIR__)));
+\Fedora\Autoloader\Autoload::addPsr4('Seld\\JsonLint\\', __DIR__);
+
diff --git a/php-jsonlint.spec b/php-jsonlint.spec
index 049ccb2..78096b7 100644
--- a/php-jsonlint.spec
+++ b/php-jsonlint.spec
@@ -24,7 +24,7 @@
Name: php-%{github_name}
Version: %{github_version}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: JSON Lint for PHP
Group: Development/Libraries
@@ -47,7 +47,7 @@ BuildRequires: php-composer(phpunit/phpunit)
# For tests: phpcompatinfo (computed from version 1.3.1)
BuildRequires: php-pcre
# For autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
%endif
Requires: php(language) >= %{php_min_ver}
@@ -55,7 +55,7 @@ Requires: php(language) >= %{php_min_ver}
Requires: php-cli
Requires: php-pcre
# For autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
Provides: php-composer(seld/jsonlint) = %{version}
@@ -128,6 +128,9 @@ exit $ret
%changelog
+* Fri Oct 21 2016 Remi Collet <remi@fedoraproject.org> - 1.4.1-2
+- switch from symfony/class-loader to fedora/autoloader
+
* Thu Sep 15 2016 Remi Collet <remi@fedoraproject.org> - 1.4.1-1
- Updated to 1.4.1