summaryrefslogtreecommitdiffstats
path: root/php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch')
-rw-r--r--php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch140
1 files changed, 140 insertions, 0 deletions
diff --git a/php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch b/php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch
new file mode 100644
index 0000000..36e02b5
--- /dev/null
+++ b/php-bartlett-PHP-CompatInfo-4.3.0-rpm.patch
@@ -0,0 +1,140 @@
+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
+@@ -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.3');
++$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';