Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 311 | All time: 7,313 This week: 43 |
Version | License | PHP version | Categories | |||
software-age-gauge 1.0.36 | Custom (specified... | 5 | HTTP, PHP 5, Parsers |
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.
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
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.';
}
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);
Files (7) |
File | Role | Description | ||
---|---|---|---|---|
src (2 files) | ||||
.travis.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation | ||
screen-shot.png | Data | Auxiliary data |
Files (7) | / | src |
File | Role | Description |
---|---|---|
data.json | Data | Auxiliary data |
Version2age.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
software-age-gauge-2020-06-02.zip 486KB | |
software-age-gauge-2020-06-02.tar.gz 487KB | |
Install with Composer |
Needed packages | ||
Class | Download | Why it is needed | Dependency |
---|---|---|---|
curl Master | .zip .tar.gz | Make HTTP connection | Required |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.