goaop / goaop-symfony-bundle

[Outdated!] Integration bridge for Go! AOP framework and Symfony
55 stars 16 forks source link

Inconsistent scanning and weaving of advices in web app and cli env. #14

Closed TheCelavi closed 7 years ago

TheCelavi commented 7 years ago

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.

TheCelavi commented 7 years ago

My bad, even with command, not all classes are weaved, only the ones in AppBundle... :(

TheCelavi commented 7 years ago

I am going to close this issue on account me being dump ass.