marc / xray
X-Ray 允许声明 Zend 引擎的 include() 和 eval() 钩子。
dev-master
2018-07-01 20:03 UTC
This package is auto-updated.
Last update: 2024-09-18 06:33:21 UTC
README
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。