• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

phiwrapper: phiwrapper是一个用于打包胖“二进制”的工具

原作者: [db:作者] 来自: 网络 收藏 邀请

phiwrapper

phiwrapper是一个用于打包胖“二进制”的工具

phiwrapper可以通过batsh使得同一文件包含不同平台的二进制,可以在不同平台运行:例如,使用phiwrapper打包Windows的PHP PE二进制和,linux的ELF二进制以及php代码,在Windows下可以双击运行file.bat文件开启服务,linux下可以用sh ./file.bat运行相同的PHP代码

目前phiwrapper支持Windows 7+和x86_64的linux、macOS系统

TODOs && WIPs

  • zip.js -- zip.js 还没有实现,你需要手动打包code和bin目录的zip到build/build.zip
  • 支持命令行参数、完整的清理、提升权限...
  • 测试和自动化测试
  • x86 unix-like系统兼容
  • 更多架构系统兼容
  • unzip体积裁剪

打包用法

依赖(Windows)

没有依赖

依赖(Unix-like)

需要nodejs

准备二进制文件

准备phiwrapper的二进制到tools目录

git clone https://github.com/longyan/phiwrapper_binaries tools

自行准备需要的二进制放置于任意子目录

例如从windows.php.net下载windows PHP二进制包,解压到bin/win

静态编译linux的php,放在bin/linuxx64

准备代码

将平台无关的代码放在任意子目录(例如code/index.html, code/hello.php)

配置

复制config.js.example为config.js, 参照文件内容创建配置

打包

mkwrapper.bat
./mkwrapper.sh

限制

phiwrapper仅仅是将多个二进制文件置于压缩包中,并非类似Mach-O的原生胖二进制,因此文件体积较大,建议针对性对要包含的二进制文件进行裁剪。

开源许可

phiwrapper使用带例外的Apache许可证2.0

这代表着你不需要在使用它生成的二进制内加入许可证文本。

Copyright 2020 LongyanLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at    http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.As an exception, if, as a result of your packing your files, portionsof this Software are embedded into an partial form of such source code,you may redistribute such embedded portions in such partial form withoutcomplying with the conditions of Sections 4(a), 4(b) and 4(d) of the License.

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap