1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
diff -up ./src/Autoloader.php.rpm ./src/Autoloader.php
--- ./src/Autoloader.php.rpm 2020-03-27 07:50:26.000000000 +0100
+++ ./src/Autoloader.php 2020-03-27 07:51:49.165983073 +0100
@@ -9,7 +9,6 @@
namespace Laminas\ZendFrameworkBridge;
use ArrayObject;
-use Composer\Autoload\ClassLoader;
use RuntimeException;
use function array_values;
@@ -50,7 +49,6 @@ class Autoloader
spl_autoload_register(self::createPrependAutoloader(
RewriteRules::namespaceReverse(),
- self::getClassLoader(),
$loaded
), true, true);
@@ -61,32 +59,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;
}
@@ -105,7 +86,7 @@ class Autoloader
return;
}
- if ($classLoader->loadClass($class)) {
+ if (\Fedora\Autoloader\Autoload::loadClass($class)) {
$legacy = $namespaces[$check]
. strtr(substr($class, strlen($check)), [
'ApiTools' => 'Apigility',
diff -up ./src/Replacements.php.rpm ./src/Replacements.php
--- ./src/Replacements.php.rpm 2020-03-27 07:50:49.818286139 +0100
+++ ./src/Replacements.php 2020-03-27 07:52:36.321742255 +0100
@@ -21,7 +21,7 @@ class Replacements
public function __construct(array $additionalReplacements = [])
{
$this->replacements = array_merge(
- require __DIR__ . '/../config/replacements.php',
+ require __DIR__ . '/config/replacements.php',
$additionalReplacements
);
|