Xray
X-Ray - PHP Engine compiler hook API (new)
Install / Use
/learn @marcioAlmada/XrayREADME
X-Ray
X-Ray allows declaration of Zend Engine include(), require() and eval() hooks.:
How to use:
// 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();
How to install:
git clone https://github.com/marcioAlmada/xray
cd xray
phpize
./configure
make
sudo make install
Finally add extension=xray.so to your /etc/php.ini
Windows Support
Pull requests welcome. Anyone?
Why?
A compiler hook API was needed in order to have a decent infrastructure for YAY. But this ended up as a more general purpose internal framework so others projects can benefit too.
Copyright
Copyright (c) 2015-* Márcio Almada. Distributed under the terms of an MIT-style license. See LICENSE for details.
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。

