2017 © Pedro Peláez
 

symfony-bundle browscap-bundle

Allows you to get browser information

image

cravler/browscap-bundle

Allows you to get browser information

  • Tuesday, September 13, 2016
  • by cravler
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Browscap/BrowscapBundle

Build Status Scrutinizer Quality Score Code Coverage, (*1)

This is a service for you that is similar to the php fucntion get_browser(). It uses https://github.com/GaretJax/phpbrowscap project., (*2)

Installation

php composer.phar require browscap/browscap-bundle:1.0.*

This will install the current version which is beta and is the master branch. I don't want to say it's stable yet until I have some more tests and real world usage under the belt, but should be good enough to use in a production site., (*3)

In your app/AppKernel.php file, (*4)

public function registerBundles()
{
    ...
    $bundles = array(
        ...
        new Browscap\BrowscapBundle\BrowscapBundle(),
        ...
    );
    ...
}

Configuration

You can see the configuration values and information by running php app/console config:dump-reference BrowscapBundle, (*5)

browscap:
    remote_ini_url:       http://tempdownloads.browserscap.com/stream.php?BrowsCapINI
    remote_ver_url:       http://tempdownloads.browserscap.com/versions/version-date.php
    cache_dir:            null # If null, use your application cache directory
    timeout:              5
    update_interval:      432000
    error_interval:       7200
    do_auto_update:       true
    update_method:        'cURL' # Supported methods: 'URL-wrapper','socket','cURL' and 'local'.
    local_file:           null # Only if used
    cache_filename:       'cache.php'
    ini_filename:         'browscap.ini'
    lowercase:            false # You need to rebuild the cache if this option is changed
    silent:               false

Usage

In your controller, you will just need to get the browser information via the dependency injection container., (*6)

// @var $browscap \Browscap\BrowscapBundle\Browscap
$browscap = $this->container->get('browscap');
$browser = $browscap->getBrowser();

In the future there might be some more functions., (*7)

The Versions

13/09 2016

dev-master

9999999-dev https://github.com/browscap/BrowscapBundle

Allows you to get browser information

  Sources   Download

MIT

The Requires

 

The Development Requires

browser browscap

13/09 2016

dev-patch-1

dev-patch-1 https://github.com/browscap/BrowscapBundle

Allows you to get browser information

  Sources   Download

MIT

The Requires

 

The Development Requires

browser browscap