Issues

ZF-10526: Zend_Controller_Request_Simple and Zend_Db_Profiler_Firebug

Issue Type: Bug Created: 2010-10-07T09:55:59.000+0000 Last Updated: 2010-10-12T13:48:16.000+0000 Status: Resolved Fix version(s): - 1.11.1 (30/Nov/10)

Reporter: Bartosz Maciaszek (bartosz.maciaszek) Assignee: Christoph Dorn (cadorn) Tags: - Zend_Controller

  • Zend_Db_Profiler
  • Zend_Wildfire

Related issues: Attachments:

Description

When Zend_Controller_Request_Simple is in use[1], and Zend_Db_Profiler_Firebug is enabled in any Zend_Db_Adapter[2], application, trying to log SQL queries via firebug, crashes in nasty way[3]. The reason is that method Zend_Wildfire_Channel_HttpHeaders::isReady() does not make sure if current request object is HTTP one (which is mandatory to log anything through firebug), and one of required methods is missing.

As a quick workaround I made some changes in Zend_Wildfire_Channel_HttpHeaders::isReady() method[4], but I believe there must be a much better way to achieve it. The bug exists (at least) in 1.10.2 and 1.10.8 - those are the versions I tried.


[1] In index.php or any other script starting application: $front->setRequest(new Zend_Controller_Request_Simple(...))

[2] For example in Bootstrap: $profiler = new Zend_Db_Profiler_Firebug; $profiler->setEnabled(true);

$db->setProfiler($profiler);

[3] The result is: Fatal error: Call to undefined method Zend_Controller_Request_Simple::getHeader() in (...)/Zend/Wildfire/Channel/HttpHeaders.php on line 276

[4] My changes in Zend_Wildfire_Channel_HttpHeaders::isReady() (at the beginning od method's body): if(false === $this->getRequest() instanceof Zend_Controller_Request_Http) { return false; }

Comments

Posted by Christoph Dorn (cadorn) on 2010-10-09T12:03:18.000+0000

Please verify patch before I merge to 1.10 branch.

Posted by Bartosz Maciaszek (bartosz.maciaszek) on 2010-10-10T23:16:05.000+0000

Looks fine, go ahead.

Posted by Maciej Hołyszko (mh) on 2010-10-11T06:36:52.000+0000

This fix causes the following strict error: "is_a(): Deprecated. Please use the instanceof operator" to be triggered on PHP < 5.3.

Posted by Christoph Dorn (cadorn) on 2010-10-11T11:07:28.000+0000

Thanks for the heads up.

See here for discussion: http://zend-framework-community.634137.n4.nabble.com/…

I'll implement recommendation once decided.

Posted by Matthew Weier O'Phinney (matthew) on 2010-10-11T11:38:42.000+0000

Christoph: ZF is supposed to run under E_STRICT, which means any method raising an E_DEPRECATED needs to be fixed. Please use "instanceof" in this case -- it takes into account inheritance, and is the proper mechanism.

Posted by Christoph Dorn (cadorn) on 2010-10-12T11:18:33.000+0000

is_a needs to be fixed.

Posted by Christoph Dorn (cadorn) on 2010-10-12T13:48:12.000+0000

Using 'instanceof' instead of is_a() now.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts