X-Ray 运行定义 Zend 引擎 include(), require() and eval() 钩子:
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
最后在你的 /etc/php.ini 中增加 extension=xray.so
extension=xray.so