AOP-PHP / AOP

AOP in PHP
Other
565 stars 95 forks source link

Is it possible to disable the execution of a single aspect during runtime? #89

Open tonix-tuft opened 9 years ago

tonix-tuft commented 9 years ago

Hi, reading the documentation, at the end:

3.2 Is it possible to enable / disable the execution of aspects during runtime ? Yes it is.

Is it possible to do the same for a single aspect registered during runtime? e.g. something like:

$pointcutId = aop_add_after('foo()', $adviceShowFoo); // ...and then somewhere else in the code aop_disable_pointcut($pointcutId) // disabling the pointcut // ...and then somewhere else in the code yet aop_enable_pointcut($pointcut); // enabling the pointcut again

Can we achieve this?