summaryrefslogtreecommitdiffstats
path: root/php-doctrine-dbal3-bin.patch
blob: 0f124837f509c79dc412c7eb5db09725a13abf35 (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
diff -up ./bin/doctrine-dbal.php.rpm ./bin/doctrine-dbal.php
--- ./bin/doctrine-dbal.php.rpm	2020-11-16 12:02:16.000000000 +0100
+++ ./bin/doctrine-dbal.php	2020-11-16 12:21:56.895094784 +0100
@@ -1,25 +1,14 @@
+#!/usr/bin/env php
 <?php
 
 use Doctrine\DBAL\Tools\Console\ConsoleRunner;
 
-$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	2020-11-16 12:07:38.948729149 +0100
+++ ./src/Tools/Console/ConsoleRunner.php	2020-11-16 12:08:24.685526402 +0100
@@ -5,7 +5,6 @@ namespace Doctrine\DBAL\Tools\Console;
 use Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand;
 use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand;
 use Exception;
-use PackageVersions\Versions;
 use Symfony\Component\Console\Application;
 use Symfony\Component\Console\Command\Command;
 
@@ -25,9 +24,7 @@ class ConsoleRunner
      */
     public static function run(ConnectionProvider $connectionProvider, $commands = [])
     {
-        $cli = new Application('Doctrine Command Line Interface', Versions::getVersion(
-            Versions::rootPackageName()
-        ));
+        $cli = new Application('Doctrine Command Line Interface', '@VERSION@');
 
         $cli->setCatchExceptions(true);
         self::addCommands($cli, $connectionProvider);