PHPackages                             quickmobile/go-aop-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. quickmobile/go-aop-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

quickmobile/go-aop-php
======================

Library for aspect-oriented programming in PHP.

1.0.0(11y ago)024.4kMITPHPPHP &gt;=5.4.0

Since Jan 8Pushed 11y ago3 watchersCompare

[ Source](https://github.com/quickmobile/go-aop-php)[ Packagist](https://packagist.org/packages/quickmobile/go-aop-php)[ RSS](/packages/quickmobile-go-aop-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (14)Used By (0)

Go! Aspect-Oriented Framework for PHP
-------------------------------------

[](#go-aspect-oriented-framework-for-php)

Go! AOP is a modern aspect-oriented framework in plain PHP with rich features for the new level of software development. Framework allows to solve a cross-cutting issues in the traditional object-oriented PHP code by providing a highly efficient and transparent hook system for your exisiting code.

[![Build Status](https://camo.githubusercontent.com/21386063256ae46c36d8141442f19b41ab117836f18bbbcda5ddec1f0f51cdab/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6c6973616368656e6b6f2f676f2d616f702d7068702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/lisachenko/go-aop-php)[![Latest Stable Version](https://camo.githubusercontent.com/5d9aff1bdc732a94389a347aa6f449ef024dcc0e030e8ec4885dce27a16eb915/68747470733a2f2f706f7365722e707567782e6f72672f6c6973616368656e6b6f2f676f2d616f702d7068702f762f737461626c652e737667)](https://packagist.org/packages/lisachenko/go-aop-php)[![Total Downloads](https://camo.githubusercontent.com/eebdc661de2ebbdc7255a58e790d0640d5410ac0458ff4d676b639c9a5bdc1c7/68747470733a2f2f706f7365722e707567782e6f72672f6c6973616368656e6b6f2f676f2d616f702d7068702f646f776e6c6f6164732e737667)](https://packagist.org/packages/lisachenko/go-aop-php)[![Daily Downloads](https://camo.githubusercontent.com/3b686a4f049a87bca822785345c1db809e875a861be9eea45c233ebf3e6fc04c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f6c6973616368656e6b6f2f676f2d616f702d7068702e737667)](https://packagist.org/packages/lisachenko/go-aop-php)[![Latest Unstable Version](https://camo.githubusercontent.com/b5c36a05fe17d745a63bf88ab69b1c36a7ba8891297247a26c6f535feb25d7a8/68747470733a2f2f706f7365722e707567782e6f72672f6c6973616368656e6b6f2f676f2d616f702d7068702f762f756e737461626c652e737667)](https://packagist.org/packages/lisachenko/go-aop-php)[![Minimum PHP Version](https://camo.githubusercontent.com/b8feeff753e7c6ff51ffd26c612be3c4f292513e413cd0c8884e665ff51dd798/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e342d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/f41df7ae3562566cc5f3a4228cad5c2e80b67f40789af8e0dfb07c1687747115/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6973616368656e6b6f2f676f2d616f702d7068702e737667)](https://packagist.org/packages/lisachenko/go-aop-php)

Features
--------

[](#features)

- Provides dynamic hook system for PHP without changes in the original source code.
- Doesn't require any PECL-extentions (php-aop, runkit, uopz) and DI-containers to work.
- Object-oriented design of aspects, joinpoints and pointcuts.
- Intercepting an execution of any public or protected method in a classes.
- Intercepting an execution of static methods and methods in final classes.
- Intercepting an execution of methods in the traits.
- Intercepting an access to the public/protected properties for objects.
- Hooks for static class initialization (after class is loaded into PHP memory).
- Hooks for object initialization (intercepting `new` keywords).
- Intercepting an invocation of system PHP functions.
- Ability to change the return value of any methods/functions via `Around` type of advice.
- Rich pointcut grammar syntax for defining pointcuts in the source code.
- Native debugging for AOP with XDebug. The code with weaved aspects is fully readable and native. You can put a breakpoint in the original class or in the aspect and it will work (for debug mode)!
- Can be integrated with any existing PHP frameworks and libraries.
- Highly optimized for production use: support of opcode cachers, lazy loading of advices and aspects, joinpoints caching, no runtime checks of pointcuts, no runtime annotations parsing, no evals and `__call` methods, no slow proxies and `call_user_func_array()`. Fast bootstraping process (2-20ms) and advice invocation.

What is AOP?
------------

[](#what-is-aop)

[AOP (Aspect-Oriented Programming)](http://en.wikipedia.org/wiki/Aspect-oriented_programming) is an approach to cross-cutting concerns, where the concerns are designed and implemented in a "modular" way (that is, with appropriate encapsulation, lack of duplication, etc.), then integrated into all the relevant execution points in a succinct and robust way, e.g. through declarative or programmatic means.

In AOP terms, the execution points are called join points, a particular set of them is called a pointcut and the new behavior that is executed before, after, or "around" a join point is called advice. You can read more about AOP in [Introduction](http://go.aopphp.com/docs/introduction/) section.

Installation
------------

[](#installation)

Go! AOP framework can be installed with composer. Installation is quite easy:

1. Download the framework using composer
2. Create an application aspect kernel
3. Configure the aspect kernel in the front controller
4. Create an aspect
5. Register the aspect in the aspect kernel

### Step 1: Download the library using composer

[](#step-1-download-the-library-using-composer)

Ask composer to download the Go! AOP framework with its dependencies by running the command:

```
$ composer require lisachenko/go-aop-php
```

Composer will install the framework to your project's `vendor/lisachenko/go-aop-php` directory.

### Step 2: Create an application aspect kernel

[](#step-2-create-an-application-aspect-kernel)

The aim of this framework is to provide easy AOP integration to your application. Your first step then is to create the `AspectKernel` class for your application. This class will manage all aspects of your application in one place.

The framework provides base class to make it easier to create your own kernel. To create your application kernel extend the abstract class `Go\Core\AspectKernel`

```
