MobileDetect PHP
Github4.8.x3.74.x2.8.xDemo
  • Introduction
  • Install
  • How to use (composer)
  • How to use (standalone)
  • The constructor
  • Example
  • Other versions
  • Demo
  • Performance
  • Contribute
  • Developing code
  • Project structure
  • Extending / Porting
  • Add new module, plugin or port
  • Plugins, Modules and Ports
  • Credits
Powered by GitBook
On this page
  • What version should I install?
  • How do I install it in my project?

Was this helpful?

Edit on GitHub

Install

How to install and use the library

PreviousIntroductionNextHow to use (composer)

Last updated 5 months ago

Was this helpful?

What version should I install?

Version
PHP version
How to use / install

2.8.x

>=5.0

git checkout 2.8.x include "Mobile_Detect.php"

3.74.x

=7.4,<8.0

git checkout 3.74.x include "src/MobileDetect.php"

4.8.x

>=8.0

git checkout 4.8.x composer require mobiledetect/mobiledetectlib

How do I install it in my project?

If you are using composer and it's autoload, then just install it .

composer require mobiledetect/mobiledetectlib

or manually including the library in composer.json:

{
  "require": {
      "mobiledetect/mobiledetectlib": "^4.8"
  }
}

If you want to install it manually, then it's probably better to use the branch "2.8.x" or "3.74.x".

Since "4.8.x" branch, the MobileDetect library is no longer stand-alone, it requires some extra classes for Cache and Exceptions.

via Composer