diff options
-rw-r--r-- | php-laminas-zendframework-bridge-rpm.patch | 74 | ||||
-rw-r--r-- | php-laminas-zendframework-bridge.spec | 7 |
2 files changed, 52 insertions, 29 deletions
diff --git a/php-laminas-zendframework-bridge-rpm.patch b/php-laminas-zendframework-bridge-rpm.patch index 439038c..6d93f84 100644 --- a/php-laminas-zendframework-bridge-rpm.patch +++ b/php-laminas-zendframework-bridge-rpm.patch @@ -1,7 +1,7 @@ diff -up ./src/Autoloader.php.rpm ./src/Autoloader.php ---- ./src/Autoloader.php.rpm 2020-09-15 07:44:23.000000000 +0200 -+++ ./src/Autoloader.php 2020-09-15 07:46:23.579538552 +0200 -@@ -9,7 +9,6 @@ +--- ./src/Autoloader.php.rpm 2021-12-21 16:21:53.000000000 +0100 ++++ ./src/Autoloader.php 2021-12-21 16:27:00.348616300 +0100 +@@ -3,7 +3,6 @@ namespace Laminas\ZendFrameworkBridge; use ArrayObject; @@ -9,39 +9,38 @@ diff -up ./src/Autoloader.php.rpm ./src/Autoloader.php use RuntimeException; use function array_values; -@@ -50,7 +49,6 @@ class Autoloader +@@ -45,15 +44,9 @@ class Autoloader + public static function load() + { + $loaded = new ArrayObject([]); +- $classLoader = self::getClassLoader(); +- +- if ($classLoader === null) { +- return; +- } spl_autoload_register(self::createPrependAutoloader( RewriteRules::namespaceReverse(), -- self::getClassLoader(), +- $classLoader, $loaded ), true, true); -@@ -61,36 +59,15 @@ class Autoloader +@@ -63,27 +56,16 @@ class Autoloader + )); } - /** -- * @return ClassLoader -- * @throws RuntimeException -- */ -- private static function getClassLoader() +- private static function getClassLoader(): ?ClassLoader - { -- if (getenv('COMPOSER_VENDOR_DIR') && file_exists(getenv('COMPOSER_VENDOR_DIR') . '/autoload.php')) { -- return include getenv('COMPOSER_VENDOR_DIR') . '/autoload.php'; +- $composerVendorDirectory = getenv('COMPOSER_VENDOR_DIR'); +- if (is_string($composerVendorDirectory)) { +- return self::getClassLoaderFromVendorDirectory($composerVendorDirectory); - } - -- if (file_exists(__DIR__ . '/../../../autoload.php')) { -- return include __DIR__ . '/../../../autoload.php'; -- } -- -- if (file_exists(__DIR__ . '/../vendor/autoload.php')) { -- return include __DIR__ . '/../vendor/autoload.php'; -- } -- -- throw new RuntimeException('Cannot detect composer autoload. Please run composer install'); +- return self::getClassLoaderFromVendorDirectory(self::UPSTREAM_COMPOSER_VENDOR_DIRECTORY) +- ?? self::getClassLoaderFromVendorDirectory(self::LOCAL_COMPOSER_VENDOR_DIRECTORY); - } - -- /** + /** * @return callable */ - private static function createPrependAutoloader(array $namespaces, ClassLoader $classLoader, ArrayObject $loaded) @@ -56,7 +55,7 @@ diff -up ./src/Autoloader.php.rpm ./src/Autoloader.php if (isset($loaded[$class])) { return; } -@@ -109,7 +86,7 @@ class Autoloader +@@ -102,7 +84,7 @@ class Autoloader return; } @@ -65,10 +64,31 @@ diff -up ./src/Autoloader.php.rpm ./src/Autoloader.php $legacy = $namespaces[$check] . strtr(substr($class, strlen($check)), [ 'ApiTools' => 'Apigility', +@@ -162,20 +144,4 @@ class Autoloader + } + }; + } +- +- private static function getClassLoaderFromVendorDirectory(string $composerVendorDirectory): ?ClassLoader +- { +- $filename = rtrim($composerVendorDirectory, '/') . '/autoload.php'; +- if (!file_exists($filename)) { +- return null; +- } +- +- /** @psalm-suppress MixedAssignment */ +- $loader = include $filename; +- if (!$loader instanceof ClassLoader) { +- return null; +- } +- +- return $loader; +- } + } diff -up ./src/Replacements.php.rpm ./src/Replacements.php ---- ./src/Replacements.php.rpm 2020-09-15 07:44:23.000000000 +0200 -+++ ./src/Replacements.php 2020-09-15 07:44:29.456906439 +0200 -@@ -21,7 +21,7 @@ class Replacements +--- ./src/Replacements.php.rpm 2021-12-21 16:21:53.000000000 +0100 ++++ ./src/Replacements.php 2021-12-21 16:21:57.865043533 +0100 +@@ -15,7 +15,7 @@ class Replacements public function __construct(array $additionalReplacements = []) { $this->replacements = array_merge( diff --git a/php-laminas-zendframework-bridge.spec b/php-laminas-zendframework-bridge.spec index 5d7e6bc..b16cb08 100644 --- a/php-laminas-zendframework-bridge.spec +++ b/php-laminas-zendframework-bridge.spec @@ -7,7 +7,7 @@ # Please, preserve the changelog entries # %global bootstrap 0 -%global gh_commit bf180a382393e7db5c1e8d0f2ec0c4af9c724baf +%global gh_commit 88bf037259869891afce6504cacc4f8a07b24d0f %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner laminas %global gh_project laminas-zendframework-bridge @@ -21,7 +21,7 @@ %endif Name: php-%{gh_project} -Version: 1.4.0 +Version: 1.4.1 Release: 1%{?dist} Summary: Alias legacy ZF class names to Laminas Project equivalents @@ -187,6 +187,9 @@ exit $ret %changelog +* Tue Dec 21 2021 Remi Collet <remi@remirepo.net> - 1.4.1-1 +- update to 1.4.1 (no change) + * Wed Sep 8 2021 Remi Collet <remi@remirepo.net> - 1.4.0-1 - update to 1.4.0 (no change) |