marc/xray

X-Ray 允许声明 Zend 引擎的 include() 和 eval() 钩子。

安装: 6

依赖: 0

建议者: 0

安全: 0

星标: 20

关注者: 5

分支: 0

开放问题: 0

语言:C

类型:扩展

dev-master 2018-07-01 20:03 UTC

This package is auto-updated.

Last update: 2024-09-18 06:33:21 UTC


README

Build Status Percentage of issues still open License

X-Ray 允许声明 Zend 引擎include()require()eval() 钩子。

如何使用

// adding a compiler hook:
xray\set_compiler_hook(function(string $source, string $filename = null) : string {
    if ($filename === null)  {
        // here we intercept source included through eval()
        // do transformations on $source and return the new $source to be included        
    }
    else {
        // here we intercept source included from a *.php file
        // do transformations on $source and return the new $source to be included
    }
});

// removing the compiler hook:
$hook = xray\restore_compiler_hook();

如何安装

git clone https://github.com/marcioAlmada/xray
cd xray
phpize
./configure
make
sudo make install

最后将 extension=xray.so 添加到您的 /etc/php.ini

Windows 支持

欢迎拉取请求。有人吗?

为什么?

需要编译器钩子 API 来构建 YAY 的合理基础设施。但最终这成为一个更通用的内部框架,因此 其他项目 也能从中受益。

版权

版权所有 (c) 2015-* Márcio Almada。在 MIT 风格许可下分发。有关详细信息,请参阅 LICENSE。