Home

Awesome

Interceptor

Build Status Code Coverage Scrutinizer Code Quality

Intercept php includes

composer require icewind/interceptor

Usage

use Icewind\Interceptor\Interceptor;

$interceptor = new Interceptor();
$interceptor->addWhiteList(__DIR__ . '/src');
$interceptor->addHook(function($code) {
    return str_replace('foo', 'bar', $code);
});

$interceptor->setUp();

require 'src/foo.php'

API