2017 © Pedro Peláez
 

library client-checker

The GEO Definition Library, browser, OS and client type

image

kipkaev55/client-checker

The GEO Definition Library, browser, OS and client type

  • Tuesday, April 18, 2017
  • by kipkaev55
  • Repository
  • 1 Watchers
  • 0 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

ClientChecker PHP

Description

This package provides information about the user's GEO, its browser, OS and client type (desktop or mobile). The library works with free GeoLite2 databases., (*1)

Install via Composer

We recommend installing this package with Composer., (*2)

Download Composer

To download Composer, run in the root directory of your project:, (*3)

curl -sS https://getcomposer.org/installer | php

You should now have the file composer.phar in your project directory., (*4)

Install Dependencies

Run in your project root:, (*5)

php composer.phar require kipkaev55/client-checker:1.1.*

You should now have the files composer.json and composer.lock as well as the directory vendor in your project directory. If you use a version control system, composer.json should be added to it., (*6)

Require Autoloader

After installing the dependencies, you need to require the Composer autoloader from your code:, (*7)

require 'vendor/autoload.php';

Usage

Straightforward:, (*8)

require_once __DIR__ . '/vendor/autoload.php'; // Autoload files using Composer autoload

use ClientChecker\Client;

$client = new Client(
    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.1.838 Yowser/2.5 Safari/537.36',
    '172.68.11.66',
    array(                                              // on version 1.0.0 use './GeoLite2-City.mmdb' instead array()
          'dbip' => array(                              //
            'type' => 'mysql',                          //
            'host' => '127.0.0.1',                      //
            'db' => 'dbip',                             //
            'user' => 'root',                           //
            'password' => '123456'                      //
          ),                                            //
          'sypex' => './SxGeoCity.dat',                 //
          // 'geoip' => './GeoLite2-City.mmdb',         //
          'sorting' => array('sypex', 'dbip', 'geoip')   //
    )                                                   //
);
/*

or

$client = new Client(
    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.1.838 Yowser/2.5 Safari/537.36',
    '172.68.11.66',
    './GeoLite2-City.mmdb',
    'ru'
); //russian locale (supports [en, de, es, fr, ja, pt-BR, ru, zh-CN])

or

$client = new Client(
    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.1.838 Yowser/2.5 Safari/537.36',
    '172.68.11.66',
    './GeoLite2-City.mmdb',
    'ru',
    'path/to/custom/regexes.php'
); //custom regexes and russian locale
*/
echo ($client->isMobile()) ? 'true' : 'false';    //false
echo "\n";
echo $client->getOs();                            //Mac OS X 10.12.4
echo "\n";
echo $client->getBrowser();                       //Yandex Browser 17.3.1
echo "\n";
$geo = $client->getIpData();
echo $geo['country'];                             //RU
echo "\n"; 
echo $geo['city'];                                //Moscow
echo "\n";
  • This software is Copyright (c) 2017 by Pro.Motion.
  • This is free software, licensed under the MIT license
  • Ua-parser PHP Library is licensed under the MIT license
  • The user agents data from the ua-parser project is licensed under the Apache license
  • The initial list of generic feature phones & smartphones came from Mobile Web OSP under the MIT license
  • The initial list of spiders was taken from Yiibu's profile project under the MIT license.
  • GeoIP2 PHP API licensed under the Apache License, Version 2.0.

The Versions

18/04 2017

dev-master

9999999-dev

The GEO Definition Library, browser, OS and client type

  Sources   Download

MIT

The Requires

 

by Valerii Kipkaev

18/04 2017

1.1.4

1.1.4.0

The GEO Definition Library, browser, OS and client type

  Sources   Download

MIT

The Requires

 

by Valerii Kipkaev

17/04 2017

1.1.3

1.1.3.0

The GEO Definition Library, browser, OS and client type

  Sources   Download

MIT

The Requires

 

by Valerii Kipkaev

17/04 2017

1.1.2

1.1.2.0

The GEO Definition Library, browser, OS and client type

  Sources   Download

MIT

The Requires

 

by Valerii Kipkaev

14/04 2017

1.1.1

1.1.1.0

The GEO Definition Library, browser, OS and client type

  Sources   Download

MIT

The Requires

 

by Valerii Kipkaev

14/04 2017

1.1.0

1.1.0.0

The GEO Definition Library, browser, OS and client type

  Sources   Download

MIT

The Requires

 

by Valerii Kipkaev

29/03 2017

1.0.0

1.0.0.0

The GEO Definition Library, browser, OS and client type

  Sources   Download

MIT

The Requires

 

by Valerii Kipkaev