Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Sep 8, 2018
1 parent 49c0880 commit 6a133e7
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions build/binary-phar-autoload.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -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__));
Expand All @@ -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();

0 comments on commit 6a133e7

Please sign in to comment.