summaryrefslogtreecommitdiffstats
path: root/php-bartlett-PHP-CompatInfo-rpm.patch
blob: f35d15c47a99a7edf4dedce5c9bf0b0c5dbc8e92 (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
diff -up ./bin/phpcompatinfo.json.dist.rpm ./bin/phpcompatinfo.json.dist
--- ./bin/phpcompatinfo.json.dist.rpm	2014-08-22 08:17:40.045281815 +0200
+++ ./bin/phpcompatinfo.json.dist	2014-08-22 08:17:46.784308376 +0200
@@ -9,6 +9,19 @@
         {
             "name": "Analyser",
             "class": "Bartlett\\Reflect\\Plugin\\Analyser\\AnalyserPlugin"
+        },
+        {
+            "name": "Cache",
+            "class": "Bartlett\\Reflect\\Plugin\\Cache\\CachePlugin",
+            "options": {
+                "adapter": "DoctrineCacheAdapter",
+                "backend": {
+                    "class": "Doctrine\\Common\\Cache\\FilesystemCache",
+                    "args": [
+                        "%{HOME}/.cache/phpreflect"
+                    ]
+                }
+            }
         }
     ],
     "analysers" : [
diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo
--- ./bin/phpcompatinfo.rpm	2014-08-21 21:09:22.000000000 +0200
+++ ./bin/phpcompatinfo	2014-08-22 08:28:20.750827392 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env php
+#!/usr/bin/php
 <?php
 ini_set('memory_limit', -1);
 
@@ -23,7 +23,26 @@ if (\Phar::running()) {
         }
     }
 }
-require_once $vendorDir . '/autoload.php';
+$vendorDir = '/usr/share/php';
+require_once $vendorDir . '/PhpParser/Autoloader.php';
+PhpParser\Autoloader::register();
+
+require_once $vendorDir . '/PHP/Timer.php';
+
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+use Symfony\Component\ClassLoader\UniversalClassLoader;
+
+$loader = new UniversalClassLoader();
+$loader->registerNamespaces(array(
+    'Doctrine\\Common\\Cache'             => $vendorDir,
+    'Symfony\\Component\\Finder'          => $vendorDir,
+    'Symfony\\Component\\EventDispatcher' => $vendorDir,
+    'Symfony\\Component\\Console'         => $vendorDir,
+    'Symfony\\Component\\ClassLoader'     => $vendorDir,
+    'Seld\\JsonLint'                      => $vendorDir,
+    'Bartlett'                            => $vendorDir,
+));
+$loader->register();
 
 if (PHP_SAPI !== 'cli') {
     return;
diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
--- ./tests/bootstrap.php.rpm	2014-08-21 21:09:22.000000000 +0200
+++ ./tests/bootstrap.php	2014-08-22 08:30:12.203270207 +0200
@@ -1,8 +1,29 @@
 <?php
 
 $baseDir   = dirname(__DIR__);
-$vendorDir = $baseDir . '/vendor';
+$vendorDir = '/usr/share/php';
 
-require_once $vendorDir . '/autoload.php';
+require_once $vendorDir . '/PhpParser/Autoloader.php';
+PhpParser\Autoloader::register();
 
+require_once $vendorDir . '/PHP/Timer.php';
+
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+use Symfony\Component\ClassLoader\UniversalClassLoader;
+
+$loader = new UniversalClassLoader();
+$loader->registerNamespaces(array(
+    'Symfony\\Component\\Finder'          => $vendorDir,
+    'Symfony\\Component\\EventDispatcher' => $vendorDir,
+    'Symfony\\Component\\Console'         => $vendorDir,
+    'Symfony\\Component\\ClassLoader'     => $vendorDir,
+    'Bartlett\\Reflect'                   => $vendorDir,
+    'Bartlett\\Tests\\CompatInfo'         => $baseDir . '/tests',
+    'Bartlett'                            => $baseDir . '/src',
+ ));
+
+$loader->register();
+
+# Class not catched by autoloader
+require $vendorDir . '/Bartlett/Reflect.php';
 require __DIR__ . '/Reference/GenericTest.php';