ZF-820: Method in Zend_Controller_Request_Http for analyzing USER_AGENT
Description
This is a feature request for a method in Zend_Controller_Request_Http to provide structured information about the request's USER_AGENT to a ZF application.
Sometimes an application must output custom markup, javascript, or css depending on the browser brand or version. Parsing the USER_AGENT of a request is difficult and error-prone, because so many browsers use nonstandard syntax.
It makes sense that the Zend Framework can provide a "best-practices" method to parse known USER_AGENT strings and return the information in some kind of canonical, structured form, using an associative array for individual information pieces for instance. Then this information can be used by the View or even by the Controller to deliver custom output in the response.
References: http://www.faqs.org/rfcs/rfc1945.html http://www.faqs.org/rfcs/rfc2068.html http://www.dotvoid.com/view.php?id=68 http://texsoft.it/index.php/…
This is probably not a mandatory feature for ZF 1.0, but we may want to revisit this in a subsequent release.
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2007-11-16T14:38:16.000+0000
Scheduling for 1.1.0
Posted by julien PAULI (doctorrock83) on 2007-11-30T04:41:53.000+0000
In addition to that, ZendFramework could care about the wonderfull PHP function called get_browser(). browscap.ini must be provided in php.ini for that function to work, so ZF could check about that, and use it if available in addition to 'standard parsings'
Posted by Wil Sinclair (wil) on 2008-04-18T13:12:04.000+0000
This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Posted by Matthew Weier O'Phinney (matthew) on 2008-04-22T10:41:11.000+0000
Scheduling for next minor release; would be good to have for use with ContextSwitch.
Posted by julien PAULI (doctorrock83) on 2009-04-30T13:59:52.000+0000
This could serve as well for a future HTTP-based caching mechanism.
I suggest the creation of classe(s) and object(s) that could answer
Just some ideas ...
Posted by Marc Hodgins (mjh_ca) on 2010-11-26T22:28:29.000+0000
Resolved by the addition of Zend_Http_UserAgent in ZF 1.11.