i'm using laravel framework with another pure php inside public directory.
but beforeMethodExecution not working for php pure classes in public directory!
.
i configured go aop in php pure autoload:
<?php
// public/ogp/AOP/ApplicationAspectKernel.php
namespace ogp\AOP;
use \ogp\AOP\Aspect\MonitorAspect;
use Go\Core\AspectKernel;
use Go\Core\AspectContainer;
/**
* Application Aspect Kernel
*/
class ApplicationAspectKernel extends AspectKernel
{
/**
* Configure an AspectContainer with advisors, aspects and pointcuts
*
* @param AspectContainer $container
*
* @return void
*/
protected function configureAop(AspectContainer $container)
{
$container->registerAspect(new MonitorAspect());
}
}
and MonitorAspect.php:
<?php
// public/ogp/AOP/Aspect/MonitorAspect.php
namespace ogp\AOP\Aspect;
use Go\Aop\Aspect;
use Go\Aop\Intercept\FieldAccess;
use Go\Aop\Intercept\MethodInvocation;
use Go\Lang\Annotation\After;
use Go\Lang\Annotation\Before;
use Go\Lang\Annotation\Around;
use Go\Lang\Annotation\Pointcut;
/**
* Monitor aspect
*/
class MonitorAspect implements Aspect
{
/**
* @param MethodInvocation $invocation Invocation
* @Before("execution(public|private|protected *\**->*(*))")
*/
public function beforeMethodExecution(MethodInvocation $invocation)
{
echo "Before method\n";
}
}
when i make a class in laravel app directory, beforeMethodExecution works. but classes in public directory not working.
hi
i'm using laravel framework with another pure php inside public directory. but beforeMethodExecution not working for php pure classes in public directory! . i configured go aop in php pure autoload:
$rootdir is laravel directory
and i have a class in public/ogp/classes directory
also i have psr-4 autoload in composer.json laravel
my ApplicationAspectKernel.php:
and MonitorAspect.php:
when i make a class in laravel app directory, beforeMethodExecution works. but classes in public directory not working.