智慧食堂-支付项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 line
721 B

  1. <?php
  2. if (Phar::canWrite()) {
  3. $dir = realpath(__DIR__ . '/src/');
  4. printf("Set target Dir %s" . PHP_EOL,$dir);
  5. $pharFile = 'swoole-ide-helper.phar';
  6. $phar = new Phar($pharFile, FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::KEY_AS_FILENAME, $pharFile);
  7. $phar->startBuffering();
  8. $phar->buildFromDirectory($dir, '/\.php$/');
  9. $phar->stopBuffering();
  10. printf("\033[0;32m" . 'Success: Packed PHP files in %s to %s ' . "\033[0m".PHP_EOL, $dir, $pharFile);
  11. } else {
  12. printf("\033[0;31m" . 'Error: `phar.readonly` is set to true,run me with `phar.readonly` disabled
  13. php -d phar.readonly=0 %s
  14. to retry this command' . "\033[0m".PHP_EOL, __FILE__) ;
  15. exit(1);
  16. }
  17. exit(0);