phiwrapperphiwrapper是一个用于打包胖“二进制”的工具 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打包用法依赖(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, 参照文件内容创建配置 打包限制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. |
请发表评论