summaryrefslogtreecommitdiffstats
path: root/php-udan11-sql-parser-autoload.patch
blob: 700f51e4b5f4694ee4b51fd7886f546b87d15af2 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
diff -up bin/highlight-query.rpm bin/highlight-query
--- bin/highlight-query.rpm	2016-09-13 13:04:29.517214693 +0200
+++ bin/highlight-query	2016-09-13 13:05:35.400519256 +0200
@@ -1,29 +1,7 @@
 #!/usr/bin/env php
 <?php
 
-$files = array(
-    __DIR__ . "/../vendor/autoload.php",
-    __DIR__ . "/../../vendor/autoload.php",
-    __DIR__ . "/../../../autoload.php",
-    "vendor/autoload.php"
-);
-
-$found = false;
-foreach ($files as $file) {
-    if (file_exists($file)) {
-        require_once $file;
-        $found = true;
-        break;
-    }
-}
-
-if (!$found) {
-    die(
-        "You need to set up the project dependencies using the following commands:" . PHP_EOL .
-        "curl -sS https://getcomposer.org/installer | php" . PHP_EOL .
-        "php composer.phar install" . PHP_EOL
-    );
-}
+require '/usr/share/php/SqlParser/autoload.php';
 
 $cli = new SqlParser\Utils\CLI();
 exit($cli->runHighlight());
diff -up bin/lint-query.rpm bin/lint-query
--- bin/lint-query.rpm	2016-09-13 13:04:29.517214693 +0200
+++ bin/lint-query	2016-09-13 13:05:58.585626435 +0200
@@ -1,29 +1,7 @@
 #!/usr/bin/env php
 <?php
 
-$files = array(
-    __DIR__ . "/../vendor/autoload.php",
-    __DIR__ . "/../../vendor/autoload.php",
-    __DIR__ . "/../../../autoload.php",
-    "vendor/autoload.php"
-);
-
-$found = false;
-foreach ($files as $file) {
-    if (file_exists($file)) {
-        require_once $file;
-        $found = true;
-        break;
-    }
-}
-
-if (!$found) {
-    die(
-        "You need to set up the project dependencies using the following commands:" . PHP_EOL .
-        "curl -sS https://getcomposer.org/installer | php" . PHP_EOL .
-        "php composer.phar install" . PHP_EOL
-    );
-}
+require '/usr/share/php/SqlParser/autoload.php';
 
 $cli = new SqlParser\Utils\CLI();
 exit($cli->runLint());