1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 09:02:59 +00:00
composer/bin/compile

24 lines
648 B
PHP
Executable file

#!/usr/bin/env php
<?php
$cwd = getcwd();
chdir(__DIR__.'/../');
// Install with the current version to force it having the right ClassLoader version
// Install without dev packages to clean up the included classmap from phpunit classes
shell_exec('php bin/composer install -q --no-dev');
chdir($cwd);
require __DIR__.'/../src/bootstrap.php';
use Composer\Compiler;
error_reporting(-1);
ini_set('display_errors', 1);
try {
$compiler = new Compiler();
$compiler->compile();
} catch (\Exception $e) {
echo 'Failed to compile phar: ['.get_class($e).'] '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().PHP_EOL;
exit(1);
}