生成 phar 包的 Apache Ant 任务?

发布于 2024-11-03 07:26:13 字数 316 浏览 4 评论 0原文

我正在将我的 php 项目移动到 phar 包,虽然 Eclipse(我使用 e4.1)很好地生成 phas,但我在相应地更新项目的部署 ant 脚本时遇到了问题...

注意: < em>我不想使用 ant 的 exec 来调用操作系统的 php 运行时来做到这一点。我不能总是依赖它...

A. 是否有一个可以生成 phar 包的 ant 任务?

B. 有没有办法无头调用Eclipse的phar导出任务?

C. 有没有办法使用 eclipse 的 php 运行时通过 ant 执行 php 脚本?

I'm moving my php projects to phar packages and while Eclipse (I'm using e4.1) generates phars nicely, I have a problem with updating project's deployment ant scripts accordingly...

NOTE: I don't want to use ant's exec to call operating system's php runtime to do that. I cannot always rely on it to be there...

A. Is there an ant task which can generate phar packages?

B. Is there a way to call Eclipse's phar export task headlessly?

C. Is there a way to execute php script by ant using eclipse's php runtime?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

信愁 2024-11-10 07:26:13

手册指出

Phar 档案可以分发为
tar 存档、zip 存档或作为
设计的自定义 Phar 文件格式
专门用于 phar 扩展。
每种文件格式都有优点和
缺点。 tar 和 zip 文件
格式可以通过读取或提取
任何可以读取的第三方工具
格式,但需要 phar 扩展名
为了与 PHP 一起运行。法尔
文件格式是定制且独特的
到 phar 扩展名,并且只能是
由 phar 扩展或创建
PEAR 包 » PHP_Archive,但是有
应用的优点
以这种格式创建的甚至可以运行
如果 phar 扩展未启用。

因此,您只需压缩一些文件并将生成的文件命名为 .phar

The manual states:

Phar archives can be distributed as
tar archives, zip archives, or as the
custom phar file format designed
specifically for the phar extension.
Each file format has advantages and
disadvantages. The tar and zip file
formats can be read or extracted by
any third-party tool that can read the
format, but require the phar extension
in order to run with PHP. The phar
file format is customized and unique
to the phar extension, and can only be
created by the phar extension or the
PEAR package » PHP_Archive, but has
the advantage that applications
created in this format will run even
if the phar extension is not enabled.

So you can just zip some files up and name the resulting file .phar.

谜泪 2024-11-10 07:26:13

Eclipse 的 PHP 运行时也是一个位于插件文件夹深处的 php 可执行文件。

Eclipse's PHP runtime is also a php executable that is located deeply in a plugin folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文