Transparent PHP AOP 1.0

Transparent PHP AOP can be used to implement Aspect Oriented Programming (AOP) in PHP in a transparent way. This means that you can add or remove aspects to a class without changing its code. It provides an alternative for the PHP require() function that includes a PHP class and transparently modifies it to insert aspect advice code in the pointcuts defined in the class code that is going to have new orthogonal aspects added.

Also, Transparent PHP AOP can automatically include advice code in automatic pointcuts, like at the begin and end of each method. The pointcuts are marked in the class modify as simple PHP comments, so the class behavior is not affect when AOP support is not being used. The automatic pointcuts do not need to be marked. This approach follows exactly the AOP theory, without need to touch a single line of 3rd-party code, for example.

Transparent PHP AOP is compiled and a new class file is generated with the code of the new aspects. The compiled class version is cached to avoid the recompilation overhead next time the same class is include using the same aspects.
The technique checks for changes in one of each XML file, or in original class file or even if new XML files were added/removed.

The aspects are defined in a separate XML file that includes the definition of the PHP advice code and the pointcuts where the code should inserted.

Optionally, the advice code can be compacted into a single line before it is inserted in the pointcuts, so the original class line numbers are preserved.
Another interesting option is to define the compiled files directory.

Requirements:
PHP 4.3.0

License type: Free for non-commercial purposes.
Date added: 6 years, 28 days ago | Last updated: 6 years, 28 days ago

More popular Utilities & Tools

This is actually one of the most advanced image hosting script. The imagetize key features: SEO, Ads Ready, Admin

Listing Files

transparent-php-aop
  • screen.jpg
  • 54.3 KB
  • 09/25/2008 03:32:26
tutorial
Hot Scripts
Sponsors