diff options
Diffstat (limited to 'php-bartlett-PHP-Reflect-rpm.patch')
-rw-r--r-- | php-bartlett-PHP-Reflect-rpm.patch | 88 |
1 files changed, 50 insertions, 38 deletions
diff --git a/php-bartlett-PHP-Reflect-rpm.patch b/php-bartlett-PHP-Reflect-rpm.patch index a219426..fd17d4c 100644 --- a/php-bartlett-PHP-Reflect-rpm.patch +++ b/php-bartlett-PHP-Reflect-rpm.patch @@ -1,6 +1,6 @@ diff -up ./bin/phpreflect.json.dist.rpm ./bin/phpreflect.json.dist ---- ./bin/phpreflect.json.dist.rpm 2018-11-25 10:01:50.000000000 +0100 -+++ ./bin/phpreflect.json.dist 2018-11-26 11:37:03.281529780 +0100 +--- ./bin/phpreflect.json.dist.rpm 2019-04-07 17:37:00.000000000 +0200 ++++ ./bin/phpreflect.json.dist 2019-04-09 14:47:07.638174748 +0200 @@ -6,6 +6,19 @@ } ], @@ -22,50 +22,62 @@ diff -up ./bin/phpreflect.json.dist.rpm ./bin/phpreflect.json.dist "analysers": [ ], diff -up ./bin/phpreflect.rpm ./bin/phpreflect ---- ./bin/phpreflect.rpm 2018-11-25 10:01:50.000000000 +0100 -+++ ./bin/phpreflect 2018-11-26 11:37:12.715581845 +0100 -@@ -2,22 +2,16 @@ - <?php - $appName = 'phpReflect'; +--- ./bin/phpreflect.rpm 2019-04-09 14:47:07.639174753 +0200 ++++ ./bin/phpreflect 2019-04-09 14:53:18.251134771 +0200 +@@ -6,28 +6,12 @@ declare(strict_types=1); --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'); -- } + gc_disable(); // performance boost + +-$possibleAutoloadPaths = [ +- // local dev repository +- __DIR__ . '/../vendor/autoload.php', +- // dependency +- __DIR__ . '/../../../../vendor/autoload.php', +-]; +$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 (!getenv("BARTLETTRC")) { -+ putenv("BARTLETTRC=" . strtolower($appName) . '.json'); -+} -+ ++ } + +-$isAutoloadFound = false; +-foreach ($possibleAutoloadPaths as $possibleAutoloadPath) { +- if (file_exists($possibleAutoloadPath)) { +- require_once $possibleAutoloadPath; +- $isAutoloadFound = true; +- break; +- } +-} +- +-if ($isAutoloadFound === false) { +- throw new RuntimeException(sprintf( +- 'Unable to find "vendor/autoload.php" in "%s" paths.', +- implode('", "', $possibleAutoloadPaths) +- )); +-} +require_once $vendorDir . '/Bartlett/Reflect/autoload.php'; -+ - if (PHP_SAPI !== 'cli') { - return; -@@ -28,5 +22,5 @@ use Bartlett\Reflect\Console\Application + $application = new \Bartlett\Reflect\Presentation\Console\Application('phpReflect'); + $application->run(); +diff -up ./src/Reflect/Presentation/Console/Application.php.rpm ./src/Reflect/Presentation/Console/Application.php +--- ./src/Reflect/Presentation/Console/Application.php.rpm 2019-04-09 14:51:38.632607939 +0200 ++++ ./src/Reflect/Presentation/Console/Application.php 2019-04-09 14:52:25.779857292 +0200 +@@ -82,12 +82,7 @@ class Application extends \Symfony\Compo - Environment::setScanDir(); + public function __construct(string $name = 'UNKNOWN') + { +- try { +- $version = \Jean85\PrettyVersions::getVersion('bartlett/php-reflect')->getPrettyVersion(); +- } catch (\OutOfBoundsException $e) { +- $version = 'UNKNOWN'; +- } +- parent::__construct($name, $version); ++ parent::__construct($name, @VERSION@); --$application = new Application($appName, '5.0-dev'); -+$application = new Application($appName, '@package_version@'); - $application->run(); + $this->baseDir = dirname(dirname(dirname(dirname(__DIR__)))); + } diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php ---- ./tests/bootstrap.php.rpm 2018-11-25 10:01:50.000000000 +0100 -+++ ./tests/bootstrap.php 2018-11-26 11:37:03.281529780 +0100 +--- ./tests/bootstrap.php.rpm 2019-04-07 17:37:00.000000000 +0200 ++++ ./tests/bootstrap.php 2019-04-09 14:47:07.639174753 +0200 @@ -1,11 +1,10 @@ <?php @@ -76,7 +88,7 @@ diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php -$loader = require_once $vendorDir . '/autoload.php'; -$loader->addClassMap( - array( -+require_once 'Bartlett/Reflect/autoload.php'; ++require_once '@BUILDROOT@/usr/share/php/Bartlett/Reflect/autoload.php'; +$tab = array( 'Bartlett\Tests\Reflect\Analyser\FooAnalyser' => __DIR__ . '/Analyser/FooAnalyser.php', |