summaryrefslogtreecommitdiffstats
path: root/php-hoa-cli-rpm.patch
blob: 80d9e914a92935ff1d9b7f7bbd82c53267b0133a (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
diff -up ./Bin/Hoa.php.rpm ./Bin/Hoa.php
--- ./Bin/Hoa.php.rpm	2016-04-06 14:42:29.000000000 +0200
+++ ./Bin/Hoa.php	2016-04-06 14:47:17.000000000 +0200
@@ -42,43 +42,8 @@ use Hoa\Router;
 /**
  * @copyright  Copyright © 2007-2016 Hoa community
  */
-if (!defined('HOA')) {
-    $composer = [
-        dirname(__DIR__) . DIRECTORY_SEPARATOR .
-        'vendor' . DIRECTORY_SEPARATOR .
-        'autoload.php',
-        dirname(__DIR__) . DIRECTORY_SEPARATOR .
-        '..' . DIRECTORY_SEPARATOR .
-        '..' . DIRECTORY_SEPARATOR .
-        'autoload.php',
-        dirname(__DIR__) . DIRECTORY_SEPARATOR .
-        '..' . DIRECTORY_SEPARATOR .
-        '..' . DIRECTORY_SEPARATOR .
-        '..' . DIRECTORY_SEPARATOR .
-        'autoload.php'
-    ];
-
-    foreach ($composer as $path) {
-        if (file_exists($path)) {
-            require_once $path;
-
-            break;
-        }
-    }
-
-    if (!defined('HOA')) {
-        require_once
-            dirname(__DIR__) . DIRECTORY_SEPARATOR .
-            '..' . DIRECTORY_SEPARATOR .
-            'Consistency' . DIRECTORY_SEPARATOR .
-            'Prelude.php';
-
-        require_once
-            dirname(__DIR__) . DIRECTORY_SEPARATOR .
-            '..' . DIRECTORY_SEPARATOR .
-            'Protocol' . DIRECTORY_SEPARATOR .
-            'Wrapper.php';
-    }
+foreach (glob('/usr/share/php/Hoa/*/autoload.php') as $file) {
+	require_once ($file);
 }
 
 Exception\Error::enableErrorHandler();
diff -up ./Bin/hoa.rpm ./Bin/hoa
--- ./Bin/hoa.rpm	2016-04-06 14:42:36.000000000 +0200
+++ ./Bin/hoa	2016-04-06 14:43:06.000000000 +0200
@@ -39,4 +39,5 @@
  * @copyright  Copyright © 2007-2016 Hoa community
  * @license    New BSD License
  */
-require_once __DIR__ . DIRECTORY_SEPARATOR . 'Hoa.php';
+require_once '/usr/share/php/Hoa/Cli/Bin/Hoa.php';
+