I will try to explain this unusual issue that occurs when scanning advices. Unfortunately, this project is not setup according to good practice, so I guess that is why this issue appeared.
It is a Symfony (v.3.3) project, consist of several bundles in src directory, something like this:
src
AppBundle
Project
AdminBundle
MessageBundle
UserBundle
So, in general, you can see that there are 3 bundles in Project directory that are not in accordance with standard recommended SF bundle/directory structure.
Here is what happens:
Every aspect in every bundle is weaved correctly only if pointcut is in class within AppBundle
If pointcut is defined in class in AdminBundle, MessageBundle, UserBundle -> those classes are not weaved, or, they are weaved sometimes, but sometimes not.
Weaving occurs when cache is cleared, and warmed up via console, or, cache is cleared and then page is loaded.
So, I started to investigate this, and stumbled upon commands that are in AOP/framework. Managed to make them work in Symfony project (btw I have opened some issue about that https://github.com/goaop/framework/issues/330).
And strange thing happened: all debug commands showed correct matching.
So I have executed bin/console cache:warmup:aop web/app_dev.php and every class regardless of it source was weaved flawlessly!
When I refreshed page, it all worked correctly.
I have no idea what is going on and why that happens, but I am hoping that you @lisachenko would have some kind of idea how to deal with this.
I will try to explain this unusual issue that occurs when scanning advices. Unfortunately, this project is not setup according to good practice, so I guess that is why this issue appeared.
It is a Symfony (v.3.3) project, consist of several bundles in src directory, something like this:
So, in general, you can see that there are 3 bundles in Project directory that are not in accordance with standard recommended SF bundle/directory structure.
Here is what happens:
Weaving occurs when cache is cleared, and warmed up via console, or, cache is cleared and then page is loaded.
So, I started to investigate this, and stumbled upon commands that are in AOP/framework. Managed to make them work in Symfony project (btw I have opened some issue about that https://github.com/goaop/framework/issues/330).
And strange thing happened: all debug commands showed correct matching.
So I have executed
bin/console cache:warmup:aop web/app_dev.php
and every class regardless of it source was weaved flawlessly!When I refreshed page, it all worked correctly.
I have no idea what is going on and why that happens, but I am hoping that you @lisachenko would have some kind of idea how to deal with this.
Do ask if you need any additional info.