summaryrefslogtreecommitdiffstats
path: root/php-doctrine-orm-bin.patch
blob: 0326446db2d1b00081b9e19359a0a2185cf2912c (plain)
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
diff -up ./bin/doctrine.php.rpm ./bin/doctrine.php
--- ./bin/doctrine.php.rpm	2021-02-24 11:42:32.000000000 +0100
+++ ./bin/doctrine.php	2021-02-24 11:43:44.654144234 +0100
@@ -1,3 +1,4 @@
+#!/usr/bin/env php
 <?php
 /*
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -20,17 +21,7 @@
 use Symfony\Component\Console\Helper\HelperSet;
 use Doctrine\ORM\Tools\Console\ConsoleRunner;
 
-$autoloadFiles = [
-    __DIR__ . '/../vendor/autoload.php',
-    __DIR__ . '/../../../autoload.php'
-];
-
-foreach ($autoloadFiles as $autoloadFile) {
-    if (file_exists($autoloadFile)) {
-        require_once $autoloadFile;
-        break;
-    }
-}
+require_once '__PHPDIR__/Doctrine/ORM/autoload.php';
 
 $directories = [getcwd(), getcwd() . DIRECTORY_SEPARATOR . 'config'];
 
diff -up ./lib/Doctrine/ORM/Tools/Setup.php.rpm ./lib/Doctrine/ORM/Tools/Setup.php
--- ./lib/Doctrine/ORM/Tools/Setup.php.rpm	2021-02-24 11:43:44.654144234 +0100
+++ ./lib/Doctrine/ORM/Tools/Setup.php	2021-02-24 11:45:51.890721815 +0100
@@ -62,7 +62,11 @@ class Setup
     public static function registerAutoloadDirectory($directory)
     {
         if (! class_exists('Doctrine\Common\ClassLoader', false)) {
-            require_once $directory . '/Doctrine/Common/ClassLoader.php';
+            if (file_exists($directory . "/Doctrine/Common3/ClassLoader.php")) {
+                require_once $directory . "/Doctrine/Common3/ClassLoader.php";
+            } else {
+                require_once $directory . "/Doctrine/Common/ClassLoader.php";
+            }
         }
 
         $loader = new ClassLoader('Doctrine', $directory);
diff -up ./tests/Doctrine/Tests/ORM/Tools/SetupTest.php.rpm ./tests/Doctrine/Tests/ORM/Tools/SetupTest.php
--- ./tests/Doctrine/Tests/ORM/Tools/SetupTest.php.rpm	2021-02-24 11:43:44.654144234 +0100
+++ ./tests/Doctrine/Tests/ORM/Tools/SetupTest.php	2021-02-24 11:45:10.370859668 +0100
@@ -57,7 +57,7 @@ class SetupTest extends OrmTestCase
 
     public function testDirectoryAutoload(): void
     {
-        Setup::registerAutoloadDirectory(__DIR__ . '/../../../../../vendor/doctrine/common/lib');
+        Setup::registerAutoloadDirectory("/usr/share/php");
 
         $this->assertEquals($this->originalAutoloaderCount + 2, count(spl_autoload_functions()));
     }