Quantcast

Browscap UserAgent adapter in ZF1 trunk...

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Browscap UserAgent adapter in ZF1 trunk...

weierophinney
Administrator
Late yesterday, I dropped in a new features adapter for our
Zend_Http_UserAgent support, based on browscap (which PHP natively
consumes via get_browser()). The commit includes full documentation and
tests; if you can, I'd appreciate testing of it before we do code freeze
for 1.12.0.

On a related note: due to a change in licensing by the WURFL project --
the free version is now AGPL -- we're dropping the WURFL adapter from
Zend_Http_UserAgent. In discussions with Zend and the CR Team, we feel
the AGPL raises too many concerns for end users with regards to how
their products must be licensed in order to comply. (This is a similar
rationale as to why we did not consider ExtJS when looking at JS
toolkits to partner with.)

As such, if you relied on the WURFL adapter in the past, you _will_ need
to change code when upgrading to ZF 1.12.0, or grab the WURFL adapter
from a previous version.

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [fw-general] Browscap UserAgent adapter in ZF1 trunk...

nebiros
Wow!, great news, I think WURFL sometimes is just too much for simple stuff, also I recommend to add something like this: https://github.com/nebiros/yasc/blob/master/library/Yasc/Http/UserAgent.php#L114, just a regex and some stuff to detect generic mobile devices, nothing fancy, but faster than all the WURFL stuff.

-- 
Juan Felipe Alvarez Saldarriaga
http://juan.im
Twitter: @nebiros
Skype: jfasaldarriaga

On Thursday, March 22, 2012 at 9:44 AM, Matthew Weier O'Phinney wrote:



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [fw-general] Browscap UserAgent adapter in ZF1 trunk...

weierophinney
Administrator
-- Juan Felipe Alvarez Saldarriaga <[hidden email]> wrote
(on Thursday, 22 March 2012, 09:50 AM -0500):
> Wow!, great news, I think WURFL sometimes is just too much for simple
> stuff, also I recommend to add something like this:
> https://github.com/nebiros/yasc/blob/master/library/Yasc/Http/UserAgent.php#L114,
> just a regex and some stuff to detect generic mobile devices, nothing
> fancy, but faster than all the WURFL stuff.

Actually, interestingly... device detection is primarily using regex
right now; wurfl/terrawurfl/deviceatlas/browscap are for reporting
_features_, or capabilities, of the detected mobile device. This allows
finer-grained decision-making. That said, you can simply choose not to
use the features detection at all, and typehint on the device type
returned (mobile, desktop, bot, etc.).

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [fw-general] Browscap UserAgent adapter in ZF1 trunk...

Mike Willbanks
> Actually, interestingly... device detection is primarily using regex
> right now; wurfl/terrawurfl/deviceatlas/browscap are for reporting
> _features_, or capabilities, of the detected mobile device. This allows
> finer-grained decision-making. That said, you can simply choose not to
> use the features detection at all, and typehint on the device type
> returned (mobile, desktop, bot, etc.).

We actually are doing this internally right now by using some more
simplistic rules and then caching the results (mostly via session).
It is actually working out extremely well since there is not as much
of a performance hit with the smaller regex.  I would be interested to
learn more about the browscap features portion - off to the
documentation!

Regards,

Mike
Loading...