summaryrefslogtreecommitdiffstats
path: root/php-bartlett-PHP-Reflect-4.0.0-rpm.patch
blob: 4ac7137e9816ce0e826b85e56fb6b0578aac2ce4 (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
diff -up ./bin/phpreflect.json.dist.rpm ./bin/phpreflect.json.dist
--- ./bin/phpreflect.json.dist.rpm	2015-06-18 13:30:46.000000000 +0200
+++ ./bin/phpreflect.json.dist	2015-06-26 09:18:15.577663962 +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/phpreflect.rpm ./bin/phpreflect
--- ./bin/phpreflect.rpm	2015-06-18 13:30:46.000000000 +0200
+++ ./bin/phpreflect	2015-06-26 10:06:59.277781055 +0200
@@ -2,35 +2,16 @@
 <?php
 $appName = 'phpReflect';
 
-if (\Phar::running()) {
-    $vendorDir = 'phar://' . strtolower($appName) . '.phar/vendor';
-} else {
-    $baseDir   = dirname(__DIR__);
-    $vendorDir = $baseDir . '/vendor';
-
-    if (!file_exists($vendorDir . '/autoload.php')) {
-        $vendorDir = dirname(dirname($baseDir));
-    }
-
-    if (!getenv("BARTLETTRC")) {
-        putenv("BARTLETTRC=" . strtolower($appName) . '.json');
-    }
+$vendorDir = '/usr/share/php';
+if (is_file('/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite')) {
+    putenv('BARTLETT_COMPATINFO_DB=/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite');
 }
-$loader = require_once $vendorDir . '/autoload.php';
-$loader->setUseIncludePath(true);
-
-if (\Phar::running()) {
-    if ($home) {
-        // when optional resources are not embedded in phar distribution,
-        // avoid PHP Warnings, and lookup first in global vendor dir (COMPOSER_HOME) if exists
-        $classMapfiltered = $fallbackClassMap($loader->getClassMap(), 'Net_Growl');
-        $loader->addClassMap($classMapfiltered);
-
-        // try to find PEAR Net_Growl classes package in folder $fallbackNetGrowlDir (see phar-stub.php)
-        $loader->add(false, $fallbackNetGrowlDir);
-    }
+if (!getenv("BARTLETTRC")) {
+    putenv("BARTLETTRC=" . strtolower($appName) . '.json');
 }
 
+require_once $vendorDir . '/Bartlett/Reflect/autoload.php';
+
 if (PHP_SAPI !== 'cli') {
     return;
 }
@@ -40,5 +21,5 @@ use Bartlett\Reflect\Console\Application
 
 Environment::setScanDir();
 
-$application = new Application($appName, '4.0');
+$application = new Application($appName, '@package_version@');
 $application->run();
diff -up ./src/Bartlett/Reflect/Console/Application.php.rpm ./src/Bartlett/Reflect/Console/Application.php
--- ./src/Bartlett/Reflect/Console/Application.php.rpm	2015-06-18 13:30:46.000000000 +0200
+++ ./src/Bartlett/Reflect/Console/Application.php	2015-06-26 09:18:15.584663991 +0200
@@ -42,7 +42,7 @@ use Symfony\Component\EventDispatcher\Ev
  * @package  PHP_Reflect
  * @author   Laurent Laville <pear@laurent-laville.org>
  * @license  http://www.opensource.org/licenses/bsd-license.php  BSD License
- * @version  Release: @package_version@
+ * @version  Release: 3.1.1
  * @link     http://php5.laurent-laville.org/reflect/
  * @since    Class available since Release 3.0.0-alpha1
  */
@@ -82,7 +82,7 @@ class Application extends BaseApplicatio
             $jsonFile =  './' . getenv("BARTLETTRC");
         }
 
-        parent::__construct($appName, '@package_version@');
+        parent::__construct($appName, $appVersion);
         $this->release = $appVersion;
 
         $defaultAnalyser = (strcasecmp($appName, 'phpcompatinfo') === 0)
diff -up tests/bootstrap.php.rpm tests/bootstrap.php
--- ./tests/bootstrap.php.rpm	2016-09-22 20:49:42.000000000 +0200
+++ ./tests/bootstrap.php	2016-10-31 18:03:22.837465194 +0100
@@ -1,11 +1,10 @@
 <?php
 
 $baseDir   = dirname(__DIR__);
-$vendorDir = $baseDir . '/vendor';
+$vendorDir = '/usr/share/php';
 
-$loader = require_once $vendorDir . '/autoload.php';
-$loader->addClassMap(
-    array(
+require_once 'Bartlett/Reflect/autoload.php';
+$tab = array(
         'Bartlett\Tests\Reflect\Analyser\FooAnalyser'
             => __DIR__ . '/Analyser/FooAnalyser.php',
         'Bartlett\Tests\Reflect\Analyser\BarAnalyser'
@@ -14,5 +13,13 @@ $loader->addClassMap(
             => __DIR__ . '/Model/GenericModelTest.php',
         'Bartlett\Tests\Reflect\Environment\YourLogger'
             => __DIR__ . '/Environment/YourLogger.php',
-    )
 );
+
+\Fedora\Autoloader\Autoload::addClassMap($tab, '/');
+\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\Tests\\Reflect', $baseDir . '/tests');
+
+// Needed when installed for 'Bartlett\CompatInfo\Analyser\CompatibilityAnalyser'
+if (is_file('/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite')) {
+   putenv("BARTLETT_COMPATINFO_DB=/usr/share/php-bartlett-PHP-CompatInfo/compatinfo.sqlite");
+}
+