Download the PHP package chronon/mobile_detect without Composer

On this page you can find all versions of the php package chronon/mobile_detect. 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 mobile_detect

CakePHP Mobile-Detect Component

CakePHP's built-in CakeRequest object can easily determine if a request is from a mobile device:

$this->request->is('mobile');

However, sometimes an application needs finer control over what to serve certain devices, such as a mobile layout to smartphones and a desktop layout to tablets. The MobileDetect project is a "lightweight PHP class for detecting mobile devices". This component, packaged as a plugin, makes MobileDetect available in a CakePHP controller.

Compatibility:

Tested with CakePHP 2.10.x, but should work fine with any CakePHP 2.x version.

NOTE: This plugin is not CakePHP 3.x compatible, but the Mobile_Detect lib is included with the CakePHP 3 app skeleton and can be used and extended as needed making this plugin unnecessary.

Installation:

Using Composer/Packagist:

In your project composer.json file:

This will install the plugin into Plugin/MobileDetect, and install the Mobile_Detect lib (from Packagist) into your Vendor directory.

In your app's Config/bootstrap.php, import composer's autoload file:

Using git:

You will need the component (packaged as a plugin), and the MobileDetect PHP library (not included). The MobileDetect library needs to be in this plugin's Vendor directory and must be named 'MobileDetect'. Using git, something like this:

Usage:

The component has only one method, named detect. It accepts two arguments: the method to pass to the MobileDetect library, and any arguments for the passed method.

Example: check if a request is from a tablet:

$result = $this->MobileDetect->detect('isTablet');

Example: check if a request is from an iOS device :

$result = $this->MobileDetect->detect('isiOS');

Example: get version number of an Android device:

$result = $this->MobileDetect->detect('version', 'Android');

See the demo at mobiledetect.net for a list of all available methods.

Example:

Let's say we want to serve a mobile layout to smartphones and a desktop layout to tablets. Instead of loading the component on every request (by adding it to your controller's $components array), we'll load the component on the fly when needed. This example sets a session variable tablet if the request is from a tablet, calling the component only once.

In Controller/AppController.php:


All versions of mobile_detect with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
composer/installers Version *
mobiledetect/mobiledetectlib Version 2.8.*
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 chronon/mobile_detect contains the following files

Loading the files please wait ....