:gem: Go! AOP PHP - modern aspect-oriented framework for the new level of software development
Version 1.2.0 is a minor release with one new feature and several fixes:
1.x
branch only to the PHP5.5, because andrewsville/php-token-reflection
can work only with PHP=<5.5 and is not maintained anymore, see #305includePath
and excludePath
options, see #300, #311Please, note, that the branch 1.x
will not receive any new features and you should plan your time to upgrade to the 2.x
versions.
Here it is! Shiny 2.0.0 version!
This version contains a lot of fixes and improvements:
Andrewswille/Token-Reflection
to the goaop/parser-reflection
library for PHP5.6 and PHP7.0 supportChanges from the 1.x branch:
!matchInherited()
to exclude all inherited methods from matchingPay attention, that some internal parts are changed, so be careful when updated. Also property interceptors logic is changed now and to modify values in advices, you should use returning by reference methods like following:
/**
* Advice that controls an access to the properties
*
* @param FieldAccess $fieldAccess Joinpoint
*
* @Around("access(public|protected Demo\Example\PropertyDemo->*)")
* @return mixed
*/
public function aroundFieldAccess(FieldAccess $fieldAccess)
{
$isRead = $fieldAccess->getAccessType() == FieldAccess::READ;
// proceed all internal advices
$fieldAccess->proceed();
if ($isRead) {
// if you want to change original property value, then return it by reference
$value = /* & */$fieldAccess->getValue();
} else {
// if you want to change value to set, then return it by reference
$value = /* & */$fieldAccess->getValueToSet();
}
echo $fieldAccess, ", value: ", json_encode($value), PHP_EOL;
}
This version contains several important fixes and improvements:
!matchInherited()
to exclude all inherited methods from matchingPay attention, that some internal parts are changed, so be careful, when updated. Also property interceptors logic is changed now and to modify values in advices, you should use returning by reference methods like following:
/**
* Advice that controls an access to the properties
*
* @param FieldAccess $fieldAccess Joinpoint
*
* @Around("access(public|protected Demo\Example\PropertyDemo->*)")
* @return mixed
*/
public function aroundFieldAccess(FieldAccess $fieldAccess)
{
$isRead = $fieldAccess->getAccessType() == FieldAccess::READ;
// proceed all internal advices
$fieldAccess->proceed();
if ($isRead) {
// if you want to change original property value, then return it by reference
$value = /* & */$fieldAccess->getValue();
} else {
// if you want to change value to set, then return it by reference
$value = /* & */$fieldAccess->getValueToSet();
}
echo $fieldAccess, ", value: ", json_encode($value), PHP_EOL;
}
Patch release fox fixing the issue #259, which dramatically reduce the performance of the framework.
1.0.0 (Feb 13, 2016)
PointcutBuilder
classincludePath
option nowFilterInjector
is now disabled by default, this job for composer integration nowMinor patch to fix a bug with overwriting of original files
Version 0.6.0 is ready! This is probably the last 0.x release and now we are going to 1.0.0.
However, this version also includes some improvements and changes:
interceptFunctions=>true
use 'features' => $defaultFeatures | Features::INTERCEPT_FUNCTIONS
nowstatic::class
for PHP>=5.5Version 0.5.0 of framework is ready!
Demo
namespace from the composer and use it only for testing.