Comments (11)
Any ideas? I'm in very bad position and had investigated the code but cant figure out the issue...
from goaop-symfony-bundle.
News: I tested with plain simple symfony demo app 3.2 (without any of my dependencies and code, wanted to make sure there's no hidden red herings) and I can confirm the issue is consistent:
- if kernel is not in debug mode, the aop doesnt work, fails silently, no errors emited, although proxy classes are correctly generated and in place
-if kernel is in debug mode, everything works as expected
Sample aspect I'm using for test:
<?php
namespace AppBundle\Aop;
use Go\Aop\Aspect;
use Go\Aop\Intercept\MethodInvocation;
use Go\Lang\Annotation\Before;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
/**
* Class Signal
* @package AppBundle\Aop
*
*/
class Signal implements Aspect
{
use ContainerAwareTrait;
/**
* @param MethodInvocation $invocation
* @Before("execution(public AppBundle\Controller\BlogController->postShowAction(*))")
*/
public function beforeMethod(MethodInvocation $invocation)
{
$this->container->get('logger')->error('-----executed signal-----');
}
}
config.yml
go_aop:
cache_warmer: true
options:
debug: %kernel.debug%
app_dir: "%kernel.root_dir%/../src/"
cache_dir: %kernel.cache_dir%/aspect
include_paths: ["%kernel.root_dir%/../src/AppBundle/Controller"]
exclude_paths: []
features: []
services.yml
signal.aspect:
class: AppBundle\Aop\Signal
calls:
- [setContainer, ['@service_container']]
tags:
- { name: goaop.aspect }
from goaop-symfony-bundle.
Hi! From your issue it's unclear what is your version of goaop/framework
and goaop/goaop-symfony-bundle
itself?
It's very hard to guess, why it isn't working. Just several points to check:
- do you use inlining of classes in your bundle (eg. classes.php) or not.
- put a breakpoint into the
GoAopBundle->boot()
method. Is it called or not? If not, then AOP is not initialized, but it's very strange.
from goaop-symfony-bundle.
First of all, thanks for the suggestions.
Related to versions:
"symfony/symfony": "^3.2"
"goaop/goaop-symfony-bundle": "2.*"
these were the versions used for the plain simple test without any of my code.
But the same issue is replicated using symfony ^2.8 and the same goaop-symfony-bundle.
I already tried the breakpoint at boot and in many other places, I can confirm the bundle is successfully booted, again it works perfectly when in debug mode (i.e. $kernel = new AppKernel('prod', **true**); )
About the inlining of classes I'm not sure what you mean, every class is in its own file; you can see the example I'm giving above with the default symfony 3.2 blog demo app.
From what I learned up to this point, it seems very possible that there's a problem related to loading the classses in debug mode vs non-debug mode.
Using XDebug I can see that when using kernel debug mode the proxy classes are used, but not when using the non-debug mode, although the bundle is correctly loaded and all the rest.
from goaop-symfony-bundle.
About the inlining of classes I'm not sure what you mean, every class is in its own file; you can see the example I'm giving above with the default symfony 3.2 blog demo app.
I was referring to the adding classes to the compiled cache technique.
Anyway, if each single class in it's own file and standard autoloader is used then everything should work. I'll try to reproduce your issue myself. Looks like this can be related to the mapping relative paths from the composer to real one.
Last check: could you please install goaop/framework
from the master branch to be sure, that this issue isn't fixed yet in the framework
from goaop-symfony-bundle.
Installed version for framework is 2.0.0
Should i try a different version?
PS: very easy setup to verify, just setup the default demo blog app with the symfony installer and use the details I gived above.
from goaop-symfony-bundle.
Installed version for framework is 2.0.0
Should i try a different version?
Yes, please: composer require goaop/framework:2.0.x-dev
from goaop-symfony-bundle.
Hi @lisachenko ,
I forced the oaop/framework:2.0.x-dev
usage and indeed the issue vanished.
Could you please push this fix to the stable release? It should stop people getting into the same problem that I did.
Anyways, thank you for your support and awesome work on this library
Cheers!
from goaop-symfony-bundle.
Hi, @atompulse! Thank you for checking, I will prepare a tag then (probably on weekends, need to recheck all issues).
For now, you could use dev-version for short period of time.
Thank you for issue reporting!
from goaop-symfony-bundle.
Version 2.1.0 is released. Now you can switch to the stable tag. Thank you!
from goaop-symfony-bundle.
@lisachenko Thank you!
Could you please also update this bundle to require the 2.1 version?
from goaop-symfony-bundle.
Related Issues (20)
- prod env cache problem HOT 9
- goaop bundle + composer optimize autoloader HOT 3
- Inconsistent scanning and weaving of advices in web app and cli env. HOT 2
- Detection of circular references which breaks weaving HOT 3
- Generator bundle - incompatibility
- Add a tests and travis-ci integration for good code quality HOT 4
- Stable version for Symfony4 HOT 1
- [Known Limitation] Compatibility with Symfony framework >= 3.4 HOT 18
- debug: true cause error in symfony 3.4.8
- Symfony 4. Problem with cache and source file editing. HOT 2
- Minimum-Stability needs to be set to "dev" HOT 5
- Fatal error: Class name must be a valid object or a string
- Unit tests not passed HOT 1
- Fatal error: Cannot declare class because the name is already in use HOT 4
- Problems with symfony cache:(clear|warmup)
- SelfValueTransformer
- Allow to use newer version of AOP framework, switch to the stable dependencies HOT 1
- Question about pointcut syntax for matching method in the class HOT 4
- You have requested a non-existent service "goaop.aspect.container". HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goaop-symfony-bundle.