From 82d6f0863e13fb73a99f54fa72f73d9e84455526 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 6 Jan 2020 13:38:50 +0100 Subject: new package --- php-laminas-zendframework-bridge-rpm.patch | 76 ++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 php-laminas-zendframework-bridge-rpm.patch (limited to 'php-laminas-zendframework-bridge-rpm.patch') diff --git a/php-laminas-zendframework-bridge-rpm.patch b/php-laminas-zendframework-bridge-rpm.patch new file mode 100644 index 0000000..0bd5dd1 --- /dev/null +++ b/php-laminas-zendframework-bridge-rpm.patch @@ -0,0 +1,76 @@ +diff -up src/Autoloader.php.rpm src/Autoloader.php +--- src/Autoloader.php.rpm 2020-01-06 11:58:27.000000000 +0100 ++++ src/Autoloader.php 2020-01-06 13:35:58.942532257 +0100 +@@ -9,7 +9,6 @@ + namespace Laminas\ZendFrameworkBridge; + + use ArrayObject; +-use Composer\Autoload\ClassLoader; + use RuntimeException; + + /** +@@ -38,7 +37,6 @@ class Autoloader + + spl_autoload_register(self::createPrependAutoloader( + RewriteRules::namespaceReverse(), +- self::getClassLoader(), + $loaded + ), true, true); + +@@ -49,32 +47,15 @@ class Autoloader + } + + /** +- * @return ClassLoader +- * @throws RuntimeException +- */ +- private static function getClassLoader() +- { +- 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 callable + */ +- private static function createPrependAutoloader(array $namespaces, ClassLoader $classLoader, ArrayObject $loaded) ++ private static function createPrependAutoloader(array $namespaces, ArrayObject $loaded) + { + /** + * @param string $class Class name to autoload + * @return void + */ +- return static function ($class) use ($namespaces, $classLoader, $loaded) { ++ return static function ($class) use ($namespaces, $loaded) { + if (isset($loaded[$class])) { + return; + } +@@ -93,7 +74,8 @@ class Autoloader + return; + } + +- if ($classLoader->loadClass($class)) { ++ if ($file = \Fedora\Autoloader\Autoload::findFileForClass($class)) { ++ \Fedora\Autoloader\includeFile($file); + $legacy = $namespaces[$check] + . strtr(substr($class, strlen($check)), [ + 'ApiTools' => 'Apigility', +diff -up src/Replacements.php.rpm src/Replacements.php +--- src/Replacements.php.rpm 2020-01-06 11:58:27.000000000 +0100 ++++ src/Replacements.php 2020-01-06 13:32:48.361356190 +0100 +@@ -16,7 +16,7 @@ class Replacements + public function __construct(array $additionalReplacements = []) + { + $this->replacements = array_merge( +- require __DIR__ . '/../config/replacements.php', ++ require __DIR__ . '/config/replacements.php', + $additionalReplacements + ); + } -- cgit