{"id":20441750,"url":"https://github.com/mix-php/mix-pack","last_synced_at":"2025-04-12T23:32:51.024Z","repository":{"id":86308632,"uuid":"162591273","full_name":"mix-php/mix-pack","owner":"mix-php","description":"将 PHP 项目打包成 Phar 文件的工具 / A tool for packaging PHP projects into Phar files","archived":false,"fork":false,"pushed_at":"2019-06-19T09:48:43.000Z","size":38,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T17:41:57.032Z","etag":null,"topics":["cli","pack","phar"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mix-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-20T14:36:41.000Z","updated_at":"2024-12-16T14:52:29.000Z","dependencies_parsed_at":"2023-03-13T09:42:46.209Z","dependency_job_id":null,"html_url":"https://github.com/mix-php/mix-pack","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix-php%2Fmix-pack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix-php%2Fmix-pack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix-php%2Fmix-pack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix-php%2Fmix-pack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mix-php","download_url":"https://codeload.github.com/mix-php/mix-pack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647257,"owners_count":21139081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","pack","phar"],"created_at":"2024-11-15T09:34:34.258Z","updated_at":"2025-04-12T23:32:51.019Z","avatar_url":"https://github.com/mix-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Mix Pack\n\n将 PHP 项目打包成 Phar 文件的工具\n\nA tool for packaging PHP projects into Phar files\n\n## 下载 (Download)\n\n- [mix-pack.phar v1.0.2](https://github.com/mix-php/mix-pack/releases/download/v1.0.2/mix-pack.phar)\n- [mix-pack.phar v1.0.1](https://github.com/mix-php/mix-pack/releases/download/v1.0.1/mix-pack.phar)\n\n## 使用 (Usage)\n\n执行打包任务：\n\n```\nphp mix-pack.phar build -d /data/app -o /data/app.phar -b bin/bootstrap.php\n```\n\n如果 `phar.readonly` 没有关闭，按如下方法执行：\n\n```\nphp -d phar.readonly=0 mix-pack.phar build -d /data/app -o /data/app.phar -b bin/bootstrap.php\n```\n\n打包成功：\n\n```\nBuild successfully!\n - Phar file: /data/app.phar\n```\n\n## 执行打包文件 (Phar)\n\n- windows\n\n指定 php 执行\n\n```\nC:\\project\u003ephp app.phar\n```\n\n- linux\n\n指定 php 执行\n\n```\n$\u003e php app.phar\n```\n\n通过环境变量的默认 php 执行\n\n```\n$\u003e ./app.phar\n```\n\n## 全部命令参数\n\n```\nphp mix-pack.phar build --help\n```\n\n- `-d, --dir`             The project directory to be packaged\n- `-o, --output`          The name of the output phar file\n- `-b, --bootstrap`       The path to the Bootstrap file\n- `-r, --regex`           Extract regular expressions\n\n## 打包的目录\n\n指定要打包的 PHP 项目所在的目录\n\n```\nphp mix-pack.phar build --dir=/data/app\n```\n\n也可使用短参数\n\n```\nphp mix-pack.phar build -d /data/app\n```\n\n## 输出的 Phar 路径\n\n指定打包后输出的 Phar 文件的路径，必须 `.phar` 后缀\n\n```\nphp mix-pack.phar build --output=/data/app.phar\n```\n\n也可使用短参数\n\n```\nphp mix-pack.phar build -o /data/app.phar\n```\n\n## 引导文件\n\n设置 Phar 文件执行时，引入的入口文件，**只能是相对路径**\n\n\u003e 非必须参数\n\n```\nphp mix-pack.phar build --bootstrap=bin/bootstrap.php\n```\n\n也可使用短参数\n\n```\nphp mix-pack.phar build -b bin/bootstrap.php\n```\n\n## 文件提取正则\n\n设置打包时提取文件的正则表达式，用于过滤掉一些不需要的文件\n\n\u003e 非必须参数\n\n```\nphp mix-pack.phar build --regex=\"/\\.php$/\"\n```\n\n也可使用短参数\n\n```\nphp mix-pack.phar build -r \"/\\.php$/\"\n```\n\n## License\n\nApache License Version 2.0, http://www.apache.org/licenses/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmix-php%2Fmix-pack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmix-php%2Fmix-pack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmix-php%2Fmix-pack/lists"}