summaryrefslogtreecommitdiffstats
path: root/php-bartlett-PHP-Reflect-rpm.patch
blob: e5202a996ec91b812a10bacc7ce0ea629b49a9e1 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
diff -up php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/bin/reflect.json.rpm php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/bin/reflect.json
--- php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/bin/reflect.json.rpm	2014-04-04 23:06:38.000000000 +0200
+++ php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/bin/reflect.json	2014-05-13 09:00:40.429251143 +0200
@@ -1,30 +1,8 @@
 {
     "source-providers": [
         {
-            "in": "phar:///var/compatinfo/branches/v3/examples/archives/PHP_CompatInfo-2.0.0.zip as CompatInfo",
-            "name": "*.php",
-            "path": "PHP/"
-        },
-        {
-            "in": "phar:///var/compatinfo/branches/v3/examples/archives/PHP_Reflect-1.0.0.tar as Reflect",
-            "path": "PHP/",
-            "name": "*.php"
-        },
-        {
-            "in": "phar:///var/compatinfo/branches/v3/examples/archives/PHP_Reflect-1.0.0.tar as ReflectAL",
-            "path": "PHP/",
-            "name": "Autoload.php"
-        },
-        {
-            "in": "phar:///var/compatinfo/branches/v3/examples/archives/phing-2.6.1.tgz as phing",
-            "name": "*.php",
-            "path": "tasks/system",
-            "notPath": "contrib/",
-            "size": "< 4K"
-        },
-        {
-            "in": "phar:///var/compatinfo/branches/v3/examples/archives/Zend-1.12.3.tgz as ZF1",
-            "name": "*.php"
+                "in": ". as current",
+                "name": "/\\.(php|inc|phtml|module|install)$/"
         }
     ],
     "plugins": [
diff -up php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/bin/reflect.rpm php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/bin/reflect
--- php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/bin/reflect.rpm	2014-04-04 23:06:38.000000000 +0200
+++ php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/bin/reflect	2014-05-13 09:00:49.864286548 +0200
@@ -1,31 +1,38 @@
-#!/usr/bin/env php
+#!/usr/bin/php
 <?php
 // CLI version
-//putenv("REFLECT=/path/to/reflect.json");
+if (!getenv("REFLECT")) {
+    $files = array(
+        realpath('./reflect.json'),
+        getenv('HOME').'/.config/phpreflect.json',
+        '/etc/phpreflect.json',
+    );
+    foreach ($files as $file) {
+        if (file_exists($file)) {
+            putenv("REFLECT=$file");
+            break;
+        }
+    }
+}
 
-$baseDir   = dirname(__DIR__);
-$vendorDir = $baseDir . '/vendor';
+$vendorDir = '/usr/share/php';
 
-if (\Phar::running()) {
-    require_once 'phar://phpreflect.phar/vendor/nikic/php-parser/lib/bootstrap.php';
-    require_once 'phar://phpreflect.phar/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-    require_once 'phar://phpreflect.phar/vendor/phpunit/php-timer/PHP/Timer.php';
-} else {
-    require_once $vendorDir . '/nikic/php-parser/lib/bootstrap.php';
-    require_once $vendorDir . '/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-    require_once $vendorDir . '/phpunit/php-timer/PHP/Timer.php';
-}
+require_once $vendorDir . '/PhpParser/Autoloader.php';
+PhpParser\Autoloader::register();
+
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+
+require_once $vendorDir . '/PHP/Timer.php';
 
 use Symfony\Component\ClassLoader\UniversalClassLoader;
 
 $loader = new UniversalClassLoader();
 $loader->registerNamespaces(array(
-    'Symfony\\Component\\Finder'          => $vendorDir . '/symfony/finder',
-    'Symfony\\Component\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher',
-    'Symfony\\Component\\Console'         => $vendorDir . '/symfony/console',
-    'Symfony\\Component\\ClassLoader'     => $vendorDir . '/symfony/class-loader',
-    'Bartlett\\Tests\\Reflect'            => $baseDir . '/tests',
-    'Bartlett'                            => $baseDir . '/src',
+    'Symfony\\Component\\Finder'          => $vendorDir,
+    'Symfony\\Component\\EventDispatcher' => $vendorDir,
+    'Symfony\\Component\\Console'         => $vendorDir,
+    'Symfony\\Component\\ClassLoader'     => $vendorDir,
+    'Bartlett'                            => $vendorDir,
 ));
 $loader->register();
 
diff -up php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/tests/bootstrap.php.rpm php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/tests/bootstrap.php
--- php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/tests/bootstrap.php.rpm	2014-04-04 23:06:38.000000000 +0200
+++ php-reflect-b45be1d0d1b5a46253f9cda894dd7717f0a64abd/tests/bootstrap.php	2014-05-13 09:00:40.429251143 +0200
@@ -1,20 +1,19 @@
 <?php
 
 $baseDir   = dirname(__DIR__);
-$vendorDir = $baseDir . '/vendor';
+$vendorDir = '/usr/share/php';
 
-require_once $vendorDir . '/nikic/php-parser/lib/bootstrap.php';
-require_once $vendorDir . '/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+require_once $vendorDir . '/PhpParser/Autoloader.php';
+PhpParser\Autoloader::register();
+
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
 
 use Symfony\Component\ClassLoader\UniversalClassLoader;
 
 $loader = new UniversalClassLoader();
 $loader->registerNamespaces(array(
-    'Symfony\\Component\\Finder'          => $vendorDir . '/symfony/finder',
-    'Symfony\\Component\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher',
-    'Symfony\\Component\\Console'         => $vendorDir . '/symfony/console',
-    'Symfony\\Component\\ClassLoader'     => $vendorDir . '/symfony/class-loader',
     'Bartlett\\Tests\\Reflect'            => $baseDir . '/tests',
     'Bartlett'                            => $baseDir . '/src',
 ));
+$loader->useIncludePath(true);
 $loader->register();