Skip to content

PHP code interceptor for PHP-AOP, based on AOP PHP extension (pecl aop-beta).

License

Notifications You must be signed in to change notification settings

aop-io/pecl-aop-interceptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PECL AOP interceptor

Interceptor using PECL AOP extension for PHP AOP.io lib (php-aop).

Provides an abstraction layer of 'PECL AOP extension', with many features to go further in the handling of the AOP with PHP. Beyond the possibilities of the PECL extension.

This package is an adapter for PHP AOP.io lib (an abstraction layer easy to use). The doc below assumes that you have already installed the PHP AOP.io lib.

Getting Started

Install PECL AOP

You can use pecl

    sudo pecl install aop-beta

or

Download the AOP PHP extension from github, compile and add the extension to your php.ini

    #Clone the repository on your computer
    git clone https://github.com/AOP-PHP/AOP
    cd AOP
    #prepare the package, you will need to have development tools for php
    phpize
    #compile the package
    ./configure
    make
    #before the installation, check that it works properly
    make test
    #install
    make install

Now you can add the following line to your php.ini to enables AOP extension

    extension=AOP.so

More doc on PECL AOP repository.

Install pecl-aop-interceptor

Download pecl-aop-interceptor (and configure your autoloader) or use composer require: "aop-io/pecl-aop-interceptor".

Usage

use Aop\Aop;

// Init
$aop = new Aop([ 'php_interceptor' => '\PeclAop\PeclAopInterceptor']);

The PECL AOP extension support the wilcard selector, example:

Aop::addBefore('MyClass::get*()', function($jp) {
  // your hack here
});

The syntax of pointcuts selectors of PECL AOP extension is documented on the page PECL AOP (pointcuts syntax).

The usage of the AOP abstraction layer is documented on AOP.io.

License

MIT (c) 2013, Nicolas Tallefourtane.

Author

Nicolas Tallefourtane - Nicolab.net
Nicolas Talle
Make a donation via Paypal

About

PHP code interceptor for PHP-AOP, based on AOP PHP extension (pecl aop-beta).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages