daylerees / anbu

Anbu profiler for the Laravel PHP Framework.
309 stars 24 forks source link

Fatal exception when using anbu #30

Open bart opened 10 years ago

bart commented 10 years ago

I wanted to try Anbu, but after updating composer and setting the service provider im getting exception 'Illuminate\Container\BindingResolutionException' with message 'Target [Anbu\Repositories\Repository] is not instantiable.' after calling ad('foo'). It seems that the package isn't really loaded because php artisan anbu:clear gives "There are no commands defined in the "anbu" namespace.".

What went wrong? Any idea?

Cysioland commented 10 years ago

I also had this problem. I fixed it, but I forgot, how :cry:

bart commented 10 years ago

Would you try to remember? Currently I use the debugbar instead, but want to try out anbu asap.

Cysioland commented 10 years ago

I'll try, cause this was non-trivial, and it would help my future projects. Off the top of my head: I remember that it had something to do with environment detection. Make sure that your dev machine uses local environment. If that isn't possible, run: php artisan anbu:clear --env=local BTW: it's another argument for having personal wiki.

bart commented 10 years ago

Im running in "local" environment, so that shouldn't be the issue. I think anbu is great, so I really will give it a try.

Anyone else with an idea maybe?

barryvdh commented 10 years ago

I think you probably haven't configured your serviceprovider correctly. the ad() function is loaded by Composer itself, but neither the commands or the Anbu classes are configured. Perhaps you added it to the wrong environment (php artisan env) or you added Anbu as the first ServiceProvider and overwritten that in the local config, instead of using append_config().

bart commented 10 years ago

Service Providers have been configured correctly. But I will give it another try these days with L5.