summaryrefslogtreecommitdiffstats
path: root/php-doctrine-dbal3-bin.patch
blob: 7deb6a25b7a39efeb6008500d59ba7e013ed234b (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-dbal.php.rpm ./bin/doctrine-dbal.php
--- ./bin/doctrine-dbal.php.rpm	2022-01-18 12:01:41.339284813 +0100
+++ ./bin/doctrine-dbal.php	2022-01-18 12:03:08.516032174 +0100
@@ -1,3 +1,4 @@
+#!/usr/bin/env php
 <?php
 
 use Doctrine\DBAL\Tools\Console\ConsoleRunner;
@@ -11,24 +12,12 @@ fwrite(
 
 echo PHP_EOL . PHP_EOL;
 
-$files       = [__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php'];
-$loader      = null;
+require '/usr/share/php/Doctrine/DBAL3/autoload.php';
+
 $cwd         = getcwd();
 $directories = [$cwd, $cwd . DIRECTORY_SEPARATOR . 'config'];
 $configFile  = null;
 
-foreach ($files as $file) {
-    if (file_exists($file)) {
-        $loader = require $file;
-
-        break;
-    }
-}
-
-if (! $loader) {
-    throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?');
-}
-
 foreach ($directories as $directory) {
     $configFile = $directory . DIRECTORY_SEPARATOR . 'cli-config.php';
 
diff -up ./src/Tools/Console/ConsoleRunner.php.rpm ./src/Tools/Console/ConsoleRunner.php
--- ./src/Tools/Console/ConsoleRunner.php.rpm	2022-01-18 12:01:41.339284813 +0100
+++ ./src/Tools/Console/ConsoleRunner.php	2022-01-18 12:04:47.473745340 +0100
@@ -2,7 +2,6 @@
 
 namespace Doctrine\DBAL\Tools\Console;
 
-use Composer\InstalledVersions;
 use Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand;
 use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand;
 use Exception;
@@ -27,7 +26,7 @@ class ConsoleRunner
      */
     public static function run(ConnectionProvider $connectionProvider, $commands = [])
     {
-        $version = InstalledVersions::getVersion('doctrine/dbal');
+        $version = '@VERSION@';
         assert($version !== null);
 
         $cli = new Application('Doctrine Command Line Interface', $version);