智慧食堂-支付项目
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617
  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);