zendframework / zend-developer-tools

Module for developer and debug tools for working with the ZF2 MVC layer.
BSD 3-Clause "New" or "Revised" License
324 stars 130 forks source link

No toolbar appears! #28

Closed ghost closed 12 years ago

ghost commented 12 years ago

Hi there, I don't know why but no toolbar appears

bjyoungblood commented 12 years ago

See the config options to enable the toolbar. I recommend copying zenddevelopertools.local.php.dist to your application's config autoload directory.

coss commented 12 years ago

If you need more help, please give me more information about what you did.

ghost commented 12 years ago

I just copied zenddevelopertools.local.php.dist to config/autoload/zenddevelopertools.local.php. profiler : 'enabled' => false,

toolbar : 'enabled' => true,

That's all i did

I did not set any matcher,collector (for profiler) nor entries (for toolbar)

coss commented 12 years ago

The profiler must be enabled, too.

ghost commented 12 years ago

If i do that i've got : Fatal error: Uncaught exception 'Zend\Di\Exception\MissingPropertyException' with message 'Missing instance/object for parameter driver for Zend\Db\Adapter\Adapter::__construct'

I use Doctrine2 ,not Zend\Db.

coss commented 12 years ago

Based on the Exception I assume that you use DI, which I have not manually tested so far. Try to disable the Zend\Db collector:

'zenddevelopertools' => array('profiler' => array('collectors' => array('db' => null)))

Not sure why the Di tries to instantiate a Zend\Db\Adapter\Adapter object, because ZDT checks if a service with that name exists, before trying to retrieve it.

coss commented 12 years ago

What ZF2 version do you use?

ghost commented 12 years ago

I'm using lastest (Zf2.1.0) I don't use Di but maybe some of vendor/modules do.

Problem is resolved with:

'collectors' =>array('db' => null),

Thank you very much @coss

ghost commented 12 years ago

Is it possible to profile Doctrine2 with zenddeveloppertools?

coss commented 12 years ago

You could a) disable module after module to identify which module does not play nice and/or b) remove the DbCollector service in the Module.php as quick and dirty work around.

I'll ask @Ocramius if the error makes sense to him, because he most certainly knows more about Di than me.

Yes, the DoctrineORMModule provides a collector for Doctrine2. See the docs.

ghost commented 12 years ago

Thank you very much! Everything works now perfectly fine and with Doctrine2 profiling too.

Ocramius commented 12 years ago

@coss the defaults of ZDT assume a Zend\Db\Adapter\Adapter, that has to be disabled when using DoctrineORMModule without an adapter. It may be better to not set a Zend\Db profiler as a default.

This also happens when enabling ZDT with a clean skeleton AFAIK.

coss commented 12 years ago

@Ocramius It does not – or better it did not, the last time I checked it. If it breaks now then something must have changed between RC5 and RC7.

But I'm still not sure, why checking for Zend\Db\Adapter\Adapter in the ServiceManager breaks something. Does the Di fallback instantiate an object when using $sm->has('SomeClass')?

Nonetheless, removing the database collector from the default list might be a good idea.

Ocramius commented 12 years ago

@coss well, yes, if the Di fallback is active (happens when you have di config) it will attempt to fetch something.

Using $sm->has('SomeClass') also returns true if there's a definition in Di for the requested item

Marco Pivetta

http://twitter.com/Ocramius

http://marco-pivetta.com

On 5 September 2012 05:20, Eric Boh notifications@github.com wrote:

@Ocramius https://github.com/Ocramius It does not – or better it did not, the last time I checked it. If it breaks now then something must have changed between RC5 and RC7.

But I'm still not sure, why checking for Zend\Db\Adapter\Adapter in the ServiceManager breaks something. Does the Di fallback instantiate an object when using $sm->has('SomeClass')?

Nonetheless, removing the database collector from the default list might be a good idea.

— Reply to this email directly or view it on GitHubhttps://github.com/zendframework/ZendDeveloperTools/issues/28#issuecomment-8286544.