From 6a133e748302e911a1d9d9351caf0846944d4a14 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sat, 8 Sep 2018 12:46:23 +0200 Subject: [PATCH] Cleanup --- build/binary-phar-autoload.php.in | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/build/binary-phar-autoload.php.in b/build/binary-phar-autoload.php.in index 6e3e370eb42..1065df26f4f 100644 --- a/build/binary-phar-autoload.php.in +++ b/build/binary-phar-autoload.php.in @@ -15,18 +15,22 @@ if (version_compare('7.1.0', PHP_VERSION, '>')) { die(1); } -if (__FILE__ == realpath($GLOBALS['_SERVER']['SCRIPT_NAME'])) { +if (__FILE__ === realpath($GLOBALS['_SERVER']['SCRIPT_NAME'])) { $execute = true; } else { $execute = false; } -$options = getopt('', array('prepend-file:')); +$options = getopt('', array('prepend-file:', 'manifest')); if (isset($options['prepend-file'])) { require $options['prepend-file']; } +if (isset($options['manifest'])) { + $printManifest = true; +} + unset($options); define('__PHPUNIT_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', __FILE__)); @@ -36,13 +40,18 @@ Phar::mapPhar('___PHAR___'); ___FILELIST___ -if ($execute) { - if (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == '--manifest') { - print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt'); - exit; - } +if (!$execute) { + exit; +} + +if (isset($printManifest)) { + print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt'); - PHPUnit\TextUI\Command::main(); + exit; } +unset($execute); + +PHPUnit\TextUI\Command::main(); + __HALT_COMPILER();