Download the PHP package neilime/zf2-browscap without Composer
On this page you can find all versions of the php package neilime/zf2-browscap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download neilime/zf2-browscap
More information about neilime/zf2-browscap
Files in neilime/zf2-browscap
Package zf2-browscap
Short Description ZF2 Browscap is a Zend Framework 2 module that provides an improved 'get_browser' function. This module could be standalone if 'browscap' configuration setting in php.ini is undefined or does not point to the correct location of the browscap.ini file
License MIT
Homepage https://github.com/neilime/zf2-browscap
Informations about the package zf2-browscap
ZF2 Browscap
⚠️ This module is for Zend Framework 2, it is deprecated ⚠️
NOTE : If you want to contribute don't hesitate, I'll review any PR.
Introduction
ZF2 Browscap is a Zend Framework 2 module that provides an improved get_browser function. This module could be standalone if "browscap" configuration setting in php.ini is undefined or does not point to the correct location of the browscap.ini file.
Contributing
If you wish to contribute to ZF2 Browscap, please read both the CONTRIBUTING.md file.
Requirements
- Zend Framework 2 (2.*)
Installation
Main Setup
By cloning project
- Install browscap by cloning it into
./vendor/
. - Clone this project into your
./vendor/
directory.
With composer
-
Add this project in your composer.json:
- Now tell composer to download ZF2 Browscap by running the command:
Post installation
- Enabling it in your
application.config.php
file.
Configuration
- string
browscap_ini_path
: (optionnal) only needed if the native php function get_browser is unavailable or ifallows_native_get_browser
option is set to false. Define the browscap.ini file path (allows locale or remote file) - Zend\Cache\Storage\StorageInterface|string|array
cache
: (optionnal) Define the cache storage adapter to store parsed browscap.ini.
Allows classname and service retrieving anZend\Cache\Storage\StorageInterface
, or an array to be use withZend\Cache\StorageFactory::factory
. This not only saves you from loading and parsing the "browscap.ini" each time, but also guarantees an optimized loading procedure. - boolean
allows_native_get_browser
: Define if the native php function get_browser could be used if it's available.
How to use ZF2 Browscap
ZF2 Browscap module provides a service, helper for views and plugin for controllers
-
Call Browscap with the service manager
-
Call Browscap in a controller "get_browser" plugin expects the same params as the native php function get_browser.
- Call Browscap in a view "get_browser" helper expects the same params as the native php function get_browser.
Tools
ZF2 Browscap provides console tools.
Features
Load & parse "browscap.ini" file (or update cached browscap.ini)
Usage
Load & parse "browscap.ini" file
php public/index.php load-browscap