compile 648 B

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