TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
韩天峰 c4b7e3022a fix(php): 修复函数use语句解析问题 4 months ago
bin feat(compiler): 添加原生类型支持和属性获取功能 4 months ago
cases 更新 1 year ago
config php2cpp init 2 years ago
docs docs: 添加 AOT 编译器类继承规则文档和预览版使用须知 4 months ago
examples fix(php): 修复函数use语句解析问题 4 months ago
phpunit test(type): 添加类型转换测试用例 4 months ago
src fix(php): 修复函数use语句解析问题 4 months ago
tests fix(php): 修复函数use语句解析问题 4 months ago
web fix 3 years ago
.clang-format update 8 months ago
.gitignore feat(compiler): 添加对ThinkPHP和Laravel项目的编译支持 5 months ago
.php-cs-fixer.dist.php fix(php): 修复字符串字面量优化导致eval函数执行异常 4 months ago
LICENSE.md docs(license): 更新版权信息归属 4 months ago
README.md fix(php): 修复代码格式化和常量定义问题 4 months ago
ast.py 支持目录处理 8 months ago
cli.php feat(compiler): 添加原生类型支持和属性获取功能 4 months ago
composer.json feat(build): 添加PHP版本要求和编译脚本版本管理功能 4 months ago
composer.lock refactor(php): 重构 PHP 编译器基础类以使用 phpx 库 4 months ago
conv.php init 3 years ago
dump.py init 3 years ago
mv.php mv.php 移至根目录,非 compiler 工具 5 months ago
package.sh feat(build): 更新打包脚本以支持版本号自动递增 4 months ago
phpunit.xml feat(compiler): 添加测试模式和静态变量重复检测功能 5 months ago
project.yml feat(build): 添加编译器构建功能并更新项目配置 4 months ago
py2php.php op 3 years ago
rounds.txt update 8 months ago
run-tests.php test(named_args): 添加命名参数功能测试用例 5 months ago
version.txt feat(build): 更新打包脚本以支持版本号自动递增 4 months ago

README.md

依赖

  • 需要 PHP-8.2 以上版本
  • 需要 GCC-9 以上版本,支持 C++17 标准
  • 需要 CMake-3.24 以上版本

预览版目前仅支持 Linux 系统,建议使用 Ubuntu 22.04

PHP

必须包含 embed 模块

PHPX

可使用 composer install 安装依赖。 进入 vendor/swoole/phpx 目录,编译 phpx

cd vendor/swoole/phpx
cmake .
make -j32

动态链接库

sudo ldconfig -p | grep php

必须包含 libphp.solibphpx.so

若编译完成,但找不到动态链接库,需要修改

vim /etc/ld.so.conf.d/swoole.conf 

添加路径

/home/swoole/workspace/projects/phpx/lib
/opt/php-8.4/lib/