Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.2

Request #15834 Add better Mac Operating System Support
Submitted: 2009-01-30 18:11 UTC
From: jladicos Assigned: jrust
Status: Closed Package: Net_UserAgent_Detect (version 2.5.0)
PHP Version: 5.2.6 OS: OS X 10.5
Roadmaps: (Not assigned)    
Subscription  


 [2009-01-30 18:11 UTC] jladicos (Jason Ladicos)
Description: ------------ Currently when I call getOSString() on a Mac I get simply "Macintosh" regardless of the actual version of OS X that I'm using. It would be nice to add support for at least Tiger, Leopard and the upcoming Snow Leopard. Test script: --------------- $sniffer = new Net_UserAgent_Detect(); $os = $sniffer->getOSString(); echo $os; Expected result: ---------------- On my box (running OS X 10.5) I would like to see: "OS X Leopard (10.5)" Actual result: -------------- The result I get is: "Macintosh"

Comments

 [2009-01-30 18:13 UTC] jladicos (Jason Ladicos)
To add this new "feature" a few lines need to be added in the detect method: $os['mactiger'] = $os['mac'] && (strpos($agt, '10.4') !== false); $os['macleopard'] = $os['mac'] && (strpos($agt, '10.5') !== false); $os['macsnowleopard'] = $os['mac'] && (strpos($agt, '10.6') !== false); and in the getOSString method where $in_osStrings is initialized: 'mactiger' => 'OS X Tiger (10.4)', 'macleopard' => 'OS X Leopard (10.5)', 'macsnowleopard' => 'OS X Snow Leopard (10.6)',
 [2010-04-15 22:57 UTC] jrust (Jason Rust)
-Status: Open +Status: Closed -Assigned To: +Assigned To: jrust
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.