Download the PHP package ricardoh/wurfl-php-api without Composer

On this page you can find all versions of the php package ricardoh/wurfl-php-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wurfl-php-api

ScientiaMobile WURFL PHP API


LICENSE

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Please refer to the COPYING file distributed with this package for the complete text of the applicable GNU Affero General Public License.

If you are not able to comply with the terms of the AGPL license, commercial licenses are available from ScientiaMobile, Inc at http://www.ScientiaMobile.com/

Getting Started

Download a release archive from wurfl site and extract it to a directory suitable for your application.

To start using the API you need to set some configuration options.

IMPORTANT: The WURFL API is closely tied to the WURFL.XML file. New versions of the WURFL.XML are compatible with old versions of the API by nature, but the reverse is NOT true. Old versions of the WURFL.XML are NOT guarenteed to be compatible with new versions of the API. Let's restate that: This API is NOT compatible with old versions of the WURFL.XML. The oldest copy of WURFL that can be used with this API is included in this distribution.

For the impatient ones

Please look sample of the configuration files in examples/demo/ directory.

Now you can use some of the WURFL_WURFLManager class methods;

Create a configuration object

  1. Set the paths to the location of the main WURFL file (you can use zip files if you have the zip extension enabled)

  2. Configure the Persistence provider by specifying the provider and the extra parameters needed to initialize the provider. The API supports the following mechanisms:

  3. Configure the Cache provider by specifying the provider and the extra parameters needed to initialize the provider. The API supports the following caching mechanisms:

Example Configuration

Using the WURFL PHP API

Getting the device

You have four methods for retrieving a device:

  1. getDeviceForRequest(WURFL_Request_GenericRequest $request) where a WURFL_Request_GenericRequest is an object which encapsulates userAgent, ua-profile, support for xhtml of the device.

  2. getDeviceForHttpRequest($_SERVER) Most of the time you will use this method, and the API will create the the WURFL_Request_GenericRequest object for you

  3. getDeviceForUserAgent(string $userAgent) Used to query the API for a given User Agent string

  4. getDevice(string $deviceID) Gets the device by its device ID (ex: apple_iphone_ver1)

Usage example:

Getting the device properties and its capabilities

The properties Device ID and Fall Back Device ID are properties of the device:

To get the value of a capability, use getCapability():

To get the value of a virtual capability, use getVirtualCapability():

Useful Methods

The root WURFL device object has some useful functions:

WURFL Reloader

WURFL can update the persistence data automatically without any configuration by checking the modification time of the WURFL file. To enable, set allow-reload to true in the config:

If you have any questions, please take a look at the documentation on http://wurfl.sourceforge.net, and/or the ScientiaMobile Support Forum at http://www.scientiamobile.com/forum


All versions of wurfl-php-api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ricardoh/wurfl-php-api contains the following files

Loading the files please wait ....