build-phar 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env php
  2. <?php
  3. /*
  4. * This file is part of Psy Shell.
  5. *
  6. * (c) 2012-2017 Justin Hileman
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. if (!is_file(dirname(__DIR__) . '/vendor/autoload.php')) {
  12. throw new RuntimeException('Missing PsySH dev dependencies in ' . dirname(__DIR__) . '/vendor/' . ', install with `composer.phar install --dev`.');
  13. }
  14. require dirname(__DIR__) . '/vendor/autoload.php';
  15. if (!class_exists('Symfony\Component\Finder\Finder')) {
  16. throw new RuntimeException('Missing PsySH dev dependencies, install with `composer.phar install --dev`.');
  17. }
  18. if (!is_file(dirname(__DIR__) . '/build-vendor/autoload.php')) {
  19. throw new RuntimeException('Missing phar vendor dependencies, install with bin/build-vendor');
  20. }
  21. use Psy\Compiler;
  22. error_reporting(-1);
  23. ini_set('display_errors', 1);
  24. $compiler = new Compiler();
  25. if (isset($_SERVER['argv']) && isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] === '--compat') {
  26. $compiler->compile('psysh-compat.phar');
  27. } else {
  28. $compiler->compile();
  29. }