2017 © Pedro PelĂĄez
 

extension xray

X-Ray allows declaration of Zend Engine include() and eval() hooks.

image

marc/xray

X-Ray allows declaration of Zend Engine include() and eval() hooks.

  • Sunday, July 1, 2018
  • by marcioAlmada
  • Repository
  • 3 Watchers
  • 13 Stars
  • 0 Installations
  • C
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

X-Ray

Build Status Percentage of issues still open License, (*1)

X-Ray allows declaration of Zend Engine include(), require() and eval() hooks.:, (*2)

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, (*3)

Windows Support

Pull requests welcome. Anyone?, (*4)

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., (*5)

Copyright (c) 2015-* MĂĄrcio Almada. Distributed under the terms of an MIT-style license. See LICENSE for details., (*6)

The Versions

01/07 2018

dev-master

9999999-dev

X-Ray allows declaration of Zend Engine include() and eval() hooks.

  Sources   Download

MIT