summaryrefslogtreecommitdiffstats
path: root/php-bartlett-PHP-CompatInfo-4.0.0-rpm.patch
blob: 03a20e20e58c13cc3619cafabf3bfbbfc3131342 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
diff -up ./bin/phpcompatinfo.json.dist.rpm ./bin/phpcompatinfo.json.dist
--- ./bin/phpcompatinfo.json.dist.rpm	2015-04-04 15:32:17.536201524 +0200
+++ ./bin/phpcompatinfo.json.dist	2015-04-04 15:32:37.776282296 +0200
@@ -6,6 +6,19 @@
         }
     ],
     "plugins": [
+        {
+            "name": "Cache",
+            "class": "Bartlett\\Reflect\\Plugin\\CachePlugin",
+            "options": {
+                "adapter": "DoctrineCacheAdapter",
+                "backend": {
+                    "class": "Doctrine\\Common\\Cache\\FilesystemCache",
+                    "args": [
+                        "%{HOME}/.cache/php-reflect"
+                    ]
+                }
+            }
+        }
     ],
     "analysers" : [
     ],
diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo
--- ./bin/phpcompatinfo.rpm	2015-04-04 08:52:23.000000000 +0200
+++ ./bin/phpcompatinfo	2015-04-04 15:33:59.668609143 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env php
+#!/usr/bin/php
 <?php
 $appName = 'phpCompatInfo';
 
@@ -16,8 +16,30 @@ if (\Phar::running()) {
         putenv("BARTLETTRC=" . strtolower($appName) . '.json');
     }
 }
-$loader = require_once $vendorDir . '/autoload.php';
-$loader->setUseIncludePath(true);
+
+putenv('BARTLETT_COMPATINFO_DB=/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite');
+
+$vendorDir = '/usr/share/php';
+require_once $vendorDir . '/PhpParser/Autoloader.php';
+PhpParser\Autoloader::register();
+
+require_once $vendorDir . '/SebastianBergmann/Version/Version.php';
+
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+use Symfony\Component\ClassLoader\UniversalClassLoader;
+
+$loader = new UniversalClassLoader();
+$loader->registerNamespaces(array(
+    'Symfony\\Component'                  => $vendorDir,
+    'Doctrine\\Common'                    => $vendorDir,
+    'phpDocumentor\\Reflection'           => $vendorDir,
+    'Seld\\JsonLint'                      => $vendorDir,
+    'JsonSchema'                          => $vendorDir,
+    'Psr\\Log'                            => $vendorDir,
+    'Monolog'                             => $vendorDir,
+    'Bartlett'                            => $vendorDir,
+));
+$loader->register();
 
 if (PHP_SAPI !== 'cli') {
     return;
@@ -28,5 +50,5 @@ use Bartlett\CompatInfo\Console\Applicat
 
 Environment::setScanDir();
 
-$application = new Application($appName, '4.0');
+$application = new Application($appName, '@package_version@');
 $application->run();
diff -up ./data/handleDB.php.rpm ./data/handleDB.php
--- ./data/handleDB.php.rpm	2015-04-04 08:52:23.000000000 +0200
+++ ./data/handleDB.php	2015-04-04 15:31:55.188112331 +0200
@@ -11,7 +11,18 @@
  * @since    Release 4.0.0alpha3
  */
 
-require_once dirname(__DIR__) . '/vendor/autoload.php';
+$baseDir   = dirname(__DIR__);
+$vendorDir = '/usr/share/php';
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+use Symfony\Component\ClassLoader\UniversalClassLoader;
+
+$loader = new UniversalClassLoader();
+$loader->registerNamespaces(array(
+    'Symfony\\Component'                  => $vendorDir,
+ ));
+
+$loader->register();
+
 require_once __DIR__ . '/ReferenceCollection.php';
 
 use Bartlett\CompatInfo\Reference\ExtensionFactory;
diff -up ./src/Bartlett/CompatInfo/Environment.php.rpm ./src/Bartlett/CompatInfo/Environment.php
--- ./src/Bartlett/CompatInfo/Environment.php.rpm	2015-04-04 08:52:23.000000000 +0200
+++ ./src/Bartlett/CompatInfo/Environment.php	2015-04-04 15:31:55.188112331 +0200
@@ -34,6 +34,10 @@ class Environment
      */
     public static function initRefDb()
     {
+        if ($database = getenv('BARTLETT_COMPATINFO_DB')) {
+            return new \PDO('sqlite:' . $database);
+        }
+
         $database = 'compatinfo.sqlite';
         $tempDir  = sys_get_temp_dir() . '/bartlett';
 
diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
--- ./tests/bootstrap.php.rpm	2015-04-04 08:52:23.000000000 +0200
+++ ./tests/bootstrap.php	2015-04-04 15:31:55.188112331 +0200
@@ -1,8 +1,31 @@
 <?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 . '/SebastianBergmann/Version/Version.php';
+
+require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+use Symfony\Component\ClassLoader\UniversalClassLoader;
+
+$loader = new UniversalClassLoader();
+$loader->registerNamespaces(array(
+    'Doctrine\\Common'                    => $vendorDir,
+    'phpDocumentor\\Reflection'           => $vendorDir,
+    'Symfony\\Component'                  => $vendorDir,
+    'Seld\\JsonLint'                      => $vendorDir,
+    'JsonSchema'                          => $vendorDir,
+    'Bartlett\\Reflect'                   => $vendorDir,
+    'Bartlett\\UmlWriter'                 => $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';