PHP Classes

AOPHP: Alter the behavior of classes with AOP

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (9 months ago) RSS 2.0 feedStarStarStar 57%Total: 150 All time: 9,087 This week: 455Up
Version License PHP version Categories
aophp 1.0GNU General Publi...5.4PHP 5, Language
Description 

Author

This package can be used to alter the behavior of classes with AOP.

Aspects may be created by specifying the object of the class to be altered.

It uses docblocks annotations to specify point cuts of functions where advice code may be inserted before or after execution of the function code.

The altered class code may be cached to avoid reprocessing the target classes.

Picture of AlexanderC
  Performance   Level  
Name: AlexanderC is available for providing paid consulting. Contact AlexanderC .
Classes: 13 packages by
Country: Moldova Moldova
Age: 35
All time rank: 7301 in Moldova Moldova
Week rank: 193 Up1 in Moldova Moldova Equal
Innovation award
Innovation award
Nominee: 3x

Details

AOPHP ===== AOPHP- AOP for PHP Requirements ------------ PHP 5.4< Main Sugar ---------- - Annotations are used as main config provider: @AOP/before(Class.Method) @AOP/after(Class.Method) - Use PHP magic to provide a natural way to do the things: $class->method('something') // instead of $AOPHP->advice($class, 'method', ['something']); - Tolerant parser: @AOP / BeFOrE ( Class . Method) @aoP / AFTeR ( Class . Method) - Flexible PointCut: @AOP/before(Class . *) @AOP/after(* . Method) - No dependencies - Fast due to built in cache with a couple of ready to use drivers - Automated cache invalidation Examples -------- For detailed examples see tests/bootstrap.php ```php <?php /** * @author AlexanderC <self@alexanderc.me> * @date 10/28/13 * @time 8:24 PM */ require __DIR__ . '/../autoload.php'; $AOPHP = \AOPHP\AOPHP::crete(); // see DocBlockTest to understand lib usage $object = new DocBlockTest(); // add target object (methods called on this) //$AOPHP->addTarget($AOPHP->createTarget($object)); // add aspect object (advices would be applied before and after calling a target) //$AOPHP->addAspect($AOPHP->createAspect(clone $object)); // call target method //$AOPHP->advice($object, 'doThings', ['"Lorem Ipsum dolor sit amet"']); // call another target method //$AOPHP->advice($object, 'doAnotherThings', ['"Lorem Ipsum dolor sit amet"']); $object->doThings("Lorem Ipsum dolor sit amet"); ``` License ------- GNU GPLv2. Copyright (c) 2013 AlexanderC <self@alexanderc.me>

  Files folder image Files (27)  
File Role Description
Files folder image.idea (8 files, 1 directory)
Files folder imagesrc (1 directory)
Files folder imagetests (2 files)
Accessible without login Plain text file autoload.php Aux. Auxiliary script
Accessible without login Plain text file LICENSE Data Auxiliary data
Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files (27)  /  .idea  
File Role Description
Files folder imagescopes (1 file)
  Accessible without login Plain text file .name Data Auxiliary data
  Accessible without login Plain text file AOPHP.iml Data Auxiliary data
  Accessible without login Plain text file encodings.xml Data Auxiliary data
  Accessible without login Plain text file misc.xml Data Auxiliary data
  Accessible without login Plain text file modules.xml Data Auxiliary data
  Accessible without login Plain text file php.xml Data Auxiliary data
  Accessible without login Plain text file vcs.xml Data Auxiliary data
  Accessible without login Plain text file workspace.xml Data Auxiliary data

  Files folder image Files (27)  /  .idea  /  scopes  
File Role Description
  Accessible without login Plain text file scope_settings.xml Data Auxiliary data

  Files folder image Files (27)  /  src  
File Role Description
Files folder imageAOPHP (4 files, 4 directories)

  Files folder image Files (27)  /  src  /  AOPHP  
File Role Description
Files folder imageCache (4 files)
Files folder imageDocBlock (3 files)
Files folder imageHelpers (1 file)
Files folder imageTraits (1 file)
  Plain text file AOPHP.php Class Class source
  Plain text file Aspect.php Class Class source
  Plain text file PointCut.php Class Class source
  Plain text file Target.php Class Class source

  Files folder image Files (27)  /  src  /  AOPHP  /  Cache  
File Role Description
  Plain text file FileSystemDriver.php Class Class source
  Plain text file IDriver.php Class Class source
  Plain text file MemcachedDriver.php Class Class source
  Plain text file MemcacheDriver.php Class Class source

  Files folder image Files (27)  /  src  /  AOPHP  /  DocBlock  
File Role Description
  Plain text file Advice.php Class Class source
  Plain text file Block.php Class Class source
  Plain text file Parser.php Class Class source

  Files folder image Files (27)  /  src  /  AOPHP  /  Helpers  
File Role Description
  Plain text file AOPConst.php Class Class source

  Files folder image Files (27)  /  src  /  AOPHP  /  Traits  
File Role Description
  Plain text file AOP.php Class Class source

  Files folder image Files (27)  /  tests  
File Role Description
  Accessible without login Plain text file bootstrap.php Example Example script
  Plain text file DocBlockTest.php Class Example script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:150
This week:0
All time:9,087
This week:455Up
 User Ratings  
 
 All time
Utility:83%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:57%StarStarStar
Rank:1672