Open memoishin opened 6 years ago
Registration of services in a DI Container is declarative and should not cause errors until the specified service is resolved.
In this case, errors will occur when u call: $app->make(LogsasasagingAspect::class)
.
But I did not understand the question. :D
As you mentioned, "errors will occur when u call: $app->make(LogsasasagingAspect::class)", however, i do not receive any error message.
Also, the aop functionality does not work. I am using Lumen 5.6. Can this be the reason why it doesn't work?
To be honest, I did not check the package works for Lumen at all. Here you need the experience of other developers who have adapted it.
Ping @lisachenko
I think @qrazi has an experience with Lumen, because he have contributed #11
I have managed to make it work using some concepts from the slides by Chris Flynn and using the demo examples that was provided.
I believed making this change in bootstrap/app.php made it work:
use Go\Aop\Features; $applicationAspectKernel = App\lib\ApplicationAspectKernel::getInstance();
$applicationAspectKernel->init([ 'debug' => true, 'appDir' => DIR . '/../app/Http/Controllers/', 'cacheDir' => DIR . '/../cache',
'features' => Features::INTERCEPT_FUNCTIONS,
]);
Right, so obviously I didn't finish testing after commit #11... 😖 Based on this issue testing the lumen integration and:
config_path
helper function, but bridge package uses ithttps://github.com/laravel/lumen-framework/pull/723/files should allow Lumen to have a more Laravel-like registration of ServiceProviders, i.e. the boot()
of each provider will only be called after the register()
of all providers has run.
I'll look more into this to get it into a proper solutions, leaving this issue open
I am registering an Aspect class in the AopServiceProvider. However, it does not seem to work.
Here is my code:
Now even if I have the code as this:
It still doesn't show any error.
This service provider has been registered as:
$app->register(App\Providers\AopServiceProvider::class);
Is this normal or is there any fix for this?