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: 87 | All time: 9,998 This week: 129 |
Version | License | PHP version | Categories | |||
pharaoh-client 1.0.0 | Custom (specified... | 5 | HTTP, PHP 5, Wireless and Mobile |
Description | Author | |
This class can detect the current HTTP request browser type |
Pharaoh-Client provides a quick and easy controlling of Client Information [Visitor]
Install the latest version using Composer:
$ composer require raggitech/pharaoh-client
then include the vendor autoload file.
Getting the Instances:
$client = \Pharaoh\Client::getInstance();
<a name="client"></a>
##############################
# Bot
##############################
// check if it's a bot
var_dump($client->isBot());
// get the bot's name
echo $client->bot();
##############################
# Main Information
##############################
// get user agent
echo $client->agent;
// get user ip
echo $client->ip;
// get referer
echo $client->referer;
// get user languages list
echo $client->languages;
// get user language
echo $client->language;
// get user language's variant
echo $client->variant;
##############################
# Device
##############################
$device = $client->device;
// Browser Engine name
echo $device->name; // WebKit
// Browser (name, version)
echo $device->browser->name; // Chrome
echo $device->browser->version; // 77.0.3865.120
// Platform (name, version)
echo $device->platform->name; // Windows
echo $device->platform->version; // 10.0
// Device Type
var_dump($device->isDesktop); // true
// if it's a phone
if($device->isPhone){
var_dump(
$device->isMobile, // true
$device->isTablet, // false
$device->isiOS, // true
$device->isAndroid, // false
);
}
Files (6) |
File | Role | Description | ||
---|---|---|---|---|
src (2 files) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
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 |
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.