Giter Site home page Giter Site logo

browscap-php's Introduction

Browser Capabilities PHP Project

This is a userland replacement for PHP's native get_browser() function, which is officially supported by the Browser Capabilities Project.

Build Status Code Coverage Scrutinizer Quality Score

Installation

Run the command below to install via Composer

composer require browscap/browscap-php

Then you may identify the current user agent like so:

use phpbrowscap\Browscap;

$browscap = new Browscap();
$info = $browscap->getBrowser();

Recommended Setup

It is highly recommended that you disable the auto update functionality, and create a background cron script to perform the update. This way, you do not make another request every time. So your usual usage would look like this:

use phpbrowscap\Browscap;

$browscap = new Browscap($cacheDir);
$browscap->doAutoUpdate = false;
$info = $browscap->getBrowser();

And you could write a cron script such as this, to run once a day:

use phpbrowscap\Browscap;

$browscap = new Browscap($cacheDir);
$browscap->updateCache();

Issues and feature requests

Please report your issues and ask for new features on the GitHub Issue Tracker at https://github.com/browscap/browscap-php/issues

Please report incorrectly identified User Agents and browser detect in the browscap.ini file here: https://github.com/browscap/browscap/issues

browscap-php's People

Contributors

mimmi20 avatar asgrim avatar garetjax avatar quentin389 avatar dominikto avatar daawesomep avatar scrutinizer-auto-fixer avatar vitorbrandao avatar jonathaningram avatar joshuaestes avatar cziegenberg avatar frederikbosch avatar wanderingzombie avatar smatyas avatar soullivaneuh avatar erunion avatar

Watchers

Samy Mukadi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.