From 4759a15268dc7bf6f456cf4da0afe416f6cd0b49 Mon Sep 17 00:00:00 2001 From: Chris Schuld Date: Mon, 8 Jul 2019 16:13:15 -0700 Subject: [PATCH] messaging for v 1.9.3 --- CHANGELOG.md | 4 ++++ README.md | 24 +++++++++++++++++++++++- lib/Browser.php | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27597ed..bb278f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ changes when it socially makes sense. ## [Unreleased] +## [1.9.3] - 2019-07-08 +### Added +- Added support for curl, wget and the Palemoon browser + ## [1.9.2] - 2019-06-26 ### Added - PHPUnit Tests for Firefox, Opera and Chrome (3684 tests, 7368 assertions) diff --git a/README.md b/README.md index 2ee7dac..e3e2595 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,12 @@ This solution identifies the following Browsers and does a best-guess on the ver * Firefox (`Browser::BROWSER_FIREFOX`) * Mozilla (`Browser::BROWSER_MOZILLA`) * Palemoon (`Browser::BROWSER_PALEMOON`) +* curl (`Browser::BROWSER_CURL`) +* wget (`Browser::BROWSER_WGET`) * Amaya (`Browser::BROWSER_AMAYA`) * Lynx (`Browser::BROWSER_LYNX`) * Safari (`Browser::BROWSER_SAFARI`) +* Playstation (`Browser::BROWSER_PLAYSTATION`) * iPhone (`Browser::BROWSER_IPHONE`) * iPod (`Browser::BROWSER_IPOD`) * Google.s Android(`Browser::BROWSER_ANDROID`) @@ -85,5 +88,24 @@ In an active project of mine we have a pretty graphically intensive and visually Searching for a way to do this at the PHP layer and not at the client layer was more of a challenge than I would have guessed; the only script available was written by Gary White and Gary no longer maintains this script because of reliability. I do agree 100% with Gary about the readability; however, there are realistic reasons to desire the user.s browser and browser version and if your visitor is not echoing a false user agent we can take an educated guess. -I based this solution off of Gary White's original work but have since replaced all of his original code. Either way, thank you to Gary. Sadly, I never was able to get in touch with him regarding this soludion. +I based this solution off of Gary White's original work but have since replaced all of his original code. Either way, thank you to Gary. Sadly, I never was able to get in touch with him regarding this solution. + +## Testing + +The testing with PHPUnit against known user agents available in tests/lists. Each file is tab delimited with the following fields: + +User Agent, User Agent Type, Browser, Version, Operating System, Operating System Version + +eg +``` +Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16 Browser Opera 12.16 Linux Linux +Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1 Browser Chrome 14.0.835.186 Macintosh OS X 10_7_2 +``` + +Tests can be run by phpunit: + +```bash +vendor/phpunit/phpunit/phpunit +``` + diff --git a/lib/Browser.php b/lib/Browser.php index c0df2e1..ef052bb 100644 --- a/lib/Browser.php +++ b/lib/Browser.php @@ -4,7 +4,7 @@ * File: Browser.php * Author: Chris Schuld (http://chrisschuld.com/) * Last Modified: June 26nd, 2019 - * @version 1.9.2 + * @version 1.9.3 * @package PegasusPHP * * Copyright (C) 2008-2019 Chris Schuld (chris@chrisschuld.com)