Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2020-06-02 (18 hours ago) | | Not yet rated by the users | | Total: 295 This week: 15 | | All time: 7,336 This week: 19 |
|
Description | | Author |
This class can estimate the age of the browser and OS it runs on.
It can check the name of the current browser accessing a site and parses it to determines the browser type, version number and operating system type.
The class can look up a list of known browsers and operating systems make educated guess of the browser age based on the version number. Innovation Award
April 2018
Winner |
Some sites require that the users use a more recent browser that is not older than a certain age and works on certain operation systems that are well supported.
This package can guess check the identification of a user browser sent via HTTP requests and detect what is the age of the version of the browser that is being used, as well the operation system that it is running.
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 23x
Winner: 2x |
|
Details
Version To Age (Software Age Gauge)
Estimates age of browser and OS software. The script stores an associative array of software names and version and timestamp pairs. It periodically connects to external servers to fetch the latest information on Firefox and Chrome browsers.
Limitations
This script knows only that which is stored in its data array.
Browsers:
* chrome
* crios
* edge
* explorer
* firefox
* fios
* lunascape
* maxthon
* safari
* mobile safari
* netsurf
* opera
* samsungbrowser
* seamonkey
Operating Systems:
* android
* ios
* macos
* windows
Usage
use peterkahl\Version2age\Version2age;
$v2a = new Version2age;
# Location of CA certificate file
# You may download and install on your server this Mozilla CA bundle
# from this page: <https://curl.haxx.se/docs/caextract.html>
$v2a->CAbundle = '/srv/certs/ca-bundle.pem';
# Location of your cache directory
$v2a->CacheDir = '/srv/cache';
# Perhaps you have user agent string like this
# $user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) CriOS/65.0.3325.152 Mobile/15E5216a Safari/604.1';
# I have used this parser at <https://github.com/peterkahl/user-agent-parser>
# to parse the above string down to
$os_name = 'iOS'; # case insensitive
$os_vers = '11.3';
$age = $v2a->GetAge($os_name, $os_vers);
$age = $age/31536000; # years
if (is_string($age) && $age == 'UNKNOWN') {
echo 'I\'m sorry. I don\'t know this software.'
}
elseif ($age >= 1) {
echo 'Your software is 1 year old or older.';
}
Crontab Job to keep up-to-date
Run the script below every 6 hours. This forces connection to external servers in order to fetch the most up-to-date data on Firefox and Chrome browsers.
use peterkahl\Version2age\Version2age;
# Location of CA certificate file
# You may download and install on your server this Mozilla CA bundle
# from this page: <https://curl.haxx.se/docs/caextract.html>
$v2a->CAbundle = '/srv/certs/ca-bundle.pem';
# Location of your cache directory
$v2a->CacheDir = '/srv/cache';
$v2a->Initialise(true);
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.