• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

namespaced/Detection/H03-May-2022-234

Mobile_Detect.jsonH A D06-May-202128.6 KiB11

Mobile_Detect.phpH A D06-May-202179.5 KiB1,461662

README.mdH A D06-May-202115 KiB284190

composer.jsonH A D06-May-2021912 2928

ruleset.xmlH A D06-May-20219.2 KiB18864

README.md

1![Mobile Detect](http://demo.mobiledetect.net/logo-github.png)
2
3> Motto: "Every business should have a mobile detection script to detect mobile readers."
4
5[![Build Status](https://travis-ci.org/serbanghita/Mobile-Detect.svg?branch=devel)](https://travis-ci.org/serbanghita/Mobile-Detect)
6[![Latest Stable Version](https://poser.pugx.org/mobiledetect/mobiledetectlib/v/stable.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib)
7[![Total Downloads](https://poser.pugx.org/mobiledetect/mobiledetectlib/downloads.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib)
8[![Daily Downloads](https://poser.pugx.org/mobiledetect/mobiledetectlib/d/daily.png)](https://packagist.org/packages/mobiledetect/mobiledetectlib)
9[![License](https://poser.pugx.org/mobiledetect/mobiledetectlib/license.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib)
10
11*Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets).
12It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.*
13
14We're committed to make Mobile_Detect the best open-source mobile detection resource and this is why before
15each release we're running [unit tests](./tests), we also research and update the detection rules on **daily**
16and **weekly** basis.
17
18Your website's _content strategy_ is important! You need a complete toolkit to deliver an experience that is _optimized_, _fast_ and _relevant_ to your users. Mobile_Detect class is a [server-side detection](http://www.w3.org/TR/mwabp/#bp-devcap-detection) tool that can help you with your RWD strategy, it is not a replacement for CSS3 media queries or other forms of client-side feature detection.
19
20##### Announcements
21
22For `2.x` branch we are no longer taking optimizations pull requests, but only new regexes and User-Agents for our tests.
23On `2.x` releases we are focusing on **new tablets only**. All the pull requests about TVs, bots or optimizations will be closed and analyzed after `3.0.0-beta` is released.
24
25Still working on `3.0.0` branch to provide you with device detection!
26We're really excited on this one!
27We would like to speed this up, but life and family gets in the way ;)
28
29Special thanks to **JetBrains** for providing licenses for **PHPStorm**. In case you never heard or tried PHPStorm, you're
30clearly missing out! [Check PHPStorm](https://www.jetbrains.com/phpstorm/) out!
31
32##### Download and demo
33
34|Download|Docs|Examples|
35|-------------|-------------|-------------|
36|[Go to releases](../../tags)|[Become a contributor](../../wiki/Become-a-contributor)|[Code examples](../../wiki/Code-examples)
37|[Mobile_Detect.php](./Mobile_Detect.php)|[History](../../wiki/History)|[:iphone: Live demo!](http://is.gd/mobiletest)
38|[Composer package](https://packagist.org/packages/mobiledetect/mobiledetectlib)|
39
40#### Continuous updates
41
42You can use [composer](https://getcomposer.org/doc/00-intro.md) in your release and update process to make sure you have the latest Mobile_Detect version.
43
44```
45composer require mobiledetect/mobiledetectlib
46```
47
48```json
49{
50    "require": {
51        "mobiledetect/mobiledetectlib": "^2.8"
52    }
53}
54```
55
56##### Help
57
58|Pledgie|Paypal|
59|-------|------|
60|[Donate :+1:](https://pledgie.com/campaigns/21856)|[Donate :beer:](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mobiledetectlib%40gmail%2ecom&lc=US&item_name=Mobile%20Detect&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)|
61
62
63I'm currently paying for hosting and spend a lot of my family time to maintain the project and planning the future releases.
64I would highly appreciate any money donations that will keep the research going.
65
66Special thanks to the community :+1: for donations, [BrowserStack](https://www.browserstack.com/) - for providing access to their great platform, [Zend](http://www.zend.com/) - for donating licenses, [Dragos Gavrila](https://twitter.com/grafician) who contributed with the logo.
67
68##### 3rd party modules / [Submit new](../../issues/new?title=New%203rd%20party%20module&body=Name, Link and Description of the module.)
69
70:point_right: Keep `Mobile_Detect.php` class in a separate `module` and do NOT include it in your script core because of the high frequency of updates.
71:point_right: When including the class into you `web application` or `module` always use `include_once '../path/to/Mobile_Detect.php` to prevent conflicts.
72
73**JavaScript**
74
75* mobile-detect.js - A [JavaScript port](https://github.com/hgoebl/mobile-detect.js) of Mobile-Detect class. Made by [Heinrich Goebl](https://github.com/hgoebl).
76
77**Varnish Cache**
78
79* [Varnish Mobile Detect](https://github.com/willemk/varnish-mobiletranslate) - Drop-in varnish solution to mobile user
80detection based on the Mobile-Detect library. Made by [willemk](https://github.com/willemk).
81* [mobiledetect2vcl](https://github.com/carlosabalde/mobiledetect2vcl) - Python script to transform the Mobile
82Detect JSON database into an UA-based mobile detection VCL subroutine easily integrable in any Varnish Cache
83configuration. Made by [Carlos Abalde](https://github.com/carlosabalde).
84
85**LUA**
86
87* [mobile-detect.lua](https://github.com/yourpalmark/mobile-detect.lua) is a port of Mobile-Detect to Lua for
88NGINX HTTP servers. Follows closely to mobile-detect.js. Supports all methods that server-side
89mobile-detect.js supports. Fully unit-tested and synced with Travis CI (Build Passing badge included).
90Made by [Mark Walters](https://github.com/yourpalmark).
91
92**PHP**
93
94**WordPress**
95
96* [WordPress Mobile Detect](https://wordpress.org/plugins/wp-mobile-detect/) - Gives you the ability to wrap that
97infographic in a `[notdevice][/notdevice]` shortcode so at the server level WordPress will
98decide to show that content only if the user is NOT on a phone or tablet.
99Made by [Jesse Friedman](https://profiles.wordpress.org/professor44/).
100
101* [mobble](https://wordpress.org/plugins/mobble/) - provides mobile related conditional functions for your site.
102e.g. `is_iphone()`, `is_mobile()` and `is_tablet()`. Made by Scott Evans.
103
104* [WordPress Responsage](https://github.com/iamspacehead/responsage) - A small WordPress theme plugin that allows
105you to make your images responsive. Made by [Adrian Ciaschetti](https://github.com/iamspacehead).
106
107* [WP247 Body Classes](https://wordpress.org/plugins/wp247-body-classes/) - Add unique classes to the `body` tag for
108easy styling based on various attributes (archive, user, post, mobile) and various WordPress "is" functions.
109Mobile attributes include type of device, Operating System, Browser, etc. Examples: .is-mobile, .is-not-mobile,
110.is-tablet, .is-ios, .is-not-ios, .is-androidos, .is-chromebrowser.
111Made by [wescleveland56](https://github.com/wescleveland56).
112
113**Drupal**
114
115* [Drupal Mobile Switch](https://www.drupal.org/project/mobile_switch) - The Mobile Switch Drupal module provides a
116automatic theme switch functionality for mobile devices, detected by Browscap or Mobile Detect.
117Made by [Siegfried Neumann](https://www.drupal.org/user/45267).
118
119* [Drupal Context Mobile Detect](https://www.drupal.org/project/context_mobile_detect) - This is a Drupal context module
120which integrates Context and PHP Mobile Detect library.
121Created by [Artem Shymko](https://www.drupal.org/user/432492).
122
123* [Drupal Mobile Detect](https://www.drupal.org/project/mobile_detect) - Lightweight mobile detect module for Drupal
124 created by [Matthew Donadio](https://www.drupal.org/user/325244).
125
126**Joomla**
127
128* [yagendoo Joomla! Mobile Detection Plugin](http://www.yagendoo.com/en/blog/free-mobile-detection-plugin-for-joomla.html) - Lightweight PHP plugin for Joomla!
129that detects a mobile browser using the Mobile Detect class.
130Made by yagendoo media.
131
132* [User Agent Detector plugin](https://github.com/renekreijveld/UserAgentDetector) - This system plugin detects the user
133agent of your website visitor and sets a session variable accordingly. Based on the user agent, the plugin detects if the
134site is running on a desktop pc, tablet or smartphone. It can also detect if the visitor is a spider bot (search engine).
135Session variable that is set: `ualayout`. Possible values: desktop, tablet, mobile, bot.
136Made by @ReneKreijveld.
137
138**Magento**
139
140* [Magento helper](http://www.magentocommerce.com/magento-connect/catalog/product/view/id/16835/) from Optimise Web enables
141the use of all functions provided by Mobile Detect. Made by [Kathir Vel](http://www.kathirvel.com).
142
143* [Magento 2 Mobile Detect Theme Change](https://github.com/EaDesgin/magento2-mobiledetect) is an extension for Magento 2
144that will change the theme or redirect to a different URL. Also containing a helper to check for the device type.
145
146**PrestaShop**
147
148* [PrestaShop](https://www.prestashop.com) is a free, secure and open source shopping cart platform. Mobile_Detect
149is included in the default package since 1.5.x.
150
151**Laravel**
152
153* [Agent](https://github.com/jenssegers/agent) is a user agent class for Laravel based on Mobile Detect with some
154additional functionality.
155Made by [Jens Segers](https://github.com/jenssegers).
156
157* [BrowserDetect](https://github.com/hisorange/browser-detect) is a browser and mobile detection package, collects
158and wrap together the best user-agent identifiers for Laravel.
159Created by [Varga Zsolt](https://github.com/hisorange).
160
161**Zend Framework**
162
163* [ZF2 Mobile-Detect](https://github.com/neilime/zf2-mobile-detect.git) is a Zend Framework 2 module that provides
164Mobile-Detect features (Mobile_Detect class as a service, helper for views and plugin controllers).
165Made by [neilime](https://github.com/neilime).
166
167* [ZF2 MobileDetectModule](https://github.com/nikolaposa/MobileDetectModule) facilitates integration of a PHP MobileDetect
168class with some ZF2-based application. Has similar idea like the existing ZF2 Mobile-Detect module,
169but differs in initialization and provision routine of the actual Mobile_Detect class.
170Appropriate view helper and controller plugin also have different conceptions.
171Made by [Nikola Posa](https://github.com/nikolaposa).
172
173**Symfony**
174
175* [Symfony2 Mobile Detect Bundle](https://github.com/suncat2000/MobileDetectBundle) is a bundle for detecting mobile devices,
176manage mobile view and redirect to the mobile and tablet version.
177Made by [Nikolay Ivlev](https://github.com/suncat2000).
178
179* [Silex Mobile Detect Service Provider](https://github.com/jbinfo/MobileDetectServiceProvider) is a service provider to
180interact with Mobile detect class methods.
181Made by [Lhassan Baazzi](https://github.com/jbinfo).
182
183**Slim Framework**
184
185* [Slim_Mobile_Detect](https://github.com/zguillez/slim_mobile_detect) implements Mobile_Detect lib for different
186responses write on Slim Framework App.
187
188**ExpressionEngine**
189
190* [EE2 Detect Mobile](https://github.com/garethtdavies/detect-mobile) is a lightweight PHP plugin for EE2 that detects
191 a mobile browser using the Mobile Detect class. Made by [Gareth Davies](https://github.com/garethtdavies).
192
193**Yii Framework**
194
195* [Yii Extension](https://github.com/iamsalnikov/MobileDetect) - Mobile detect plugin for Yii framework.
196Made by [Alexey Salnikov](https://github.com/iamsalnikov).
197
198* [Yii Extension](https://github.com/candasm/yii1-mobile-detect-component) - Mobile detect component for Yii framework
1991.x version which supports composer package manager. Made by [Candas Minareci](https://github.com/candasm).
200
201* [Yii2 Device Detect](https://github.com/alexandernst/yii2-device-detect/) - Yii2 extension for Mobile-Detect library.
202Made by [Alexander Nestorov](https://github.com/alexandernst).
203
204**CakePHP**
205
206* [CakePHP MobileDetect](https://github.com/chronon/CakePHP-MobileDetectComponent-Plugin) is a plugin component for
207CakePHP 2.x. Made by [Gregory Gaskill](https://github.com/chronon).
208
209**FuelPHP**
210
211* [Special Agent](https://github.com/rob-bar/special_agent) is a FuelPHP package which uses php-mobile-detect to
212determine whether a device is mobile or not. It overrides the Fuelphp Agent class its methods.
213Made by [Robbie Bardjin](https://github.com/rob-bar).
214
215
216**TYPO3**
217
218* [px_mobiledetect](https://typo3.org/extensions/repository/view/px_mobiledetect) is an extension that helps to detect
219visitor's mobile device class (if that’s tablet or mobile device like smartphone). Made by Alexander Tretyak.
220
221**Other**
222
223* [PageCache](https://github.com/mmamedov/page-cache) is a lightweight PHP library for full page cache,
224with built-in Mobile-Detect support. Made by [Muhammed Mamedov](https://github.com/mmamedov).
225
226* [Statamic CMS Mobile Detect](https://github.com/haikulab/statamic-mobile-detect) is a plugin.
227Made by [Sergei Filippov](https://github.com/haikulab/statamic-mobile-detect) of Haiku Lab.
228
229* [Kohana Mobile Detect](https://github.com/madeinnordeste/kohana-mobile-detect) is an example of implementation of
230Mobile_Detect class with Kohana framework.
231Written by [Luiz Alberto S. Ribeiro](https://github.com/madeinnordeste).
232
233* [MemHT](https://www.memht.com) is a Free PHP CMS and Blog that permit the creation and the management online
234of websites with few and easy steps. Has the class included in the core.
235
236* [concrete5](https://www.concrete5.org) is a CMS that is free and open source. The library is included in the core.
237
238* [engine7](https://github.com/QOXCorp/exengine) is PHP Open Source Framework. The Mobile_Detect class is included in
239the engine.
240
241* [Zikula](http://zikula.org) is a free and open-source Content Management Framework, which allows you to run
242impressive websites and build powerful online applications. The core uses Mobile-Detect to switch to a special
243Mobile theme, using jQueryMobile.
244
245* [UserAgentInfo](https://github.com/quentin389/UserAgentInfo) is a PHP class for parsing user agent strings
246(HTTP_USER_AGENT). Includes mobile checks, bot checks, browser types/versions and more.
247Based on browscap, Mobile_Detect and ua-parser. Created for high traffic websites and fast batch processing.
248Made by [quentin389](https://github.com/quentin389).
249
250* [LJ Mobile Detect](https://github.com/lewisjenkins/craft-lj-mobiledetect) is a simple implementation of Mobile Detect
251for Craft CMS. Made by [Lewis Jenkins](https://github.com/lewisjenkins).
252
253* [Grav Plugin Mobile Detect](https://github.com/dimitrilongo/grav-plugin-mobile-detect/) is a simple implementation
254of Mobile Detect for Grav CMS. Made by [Dimitri Longo](https://github.com/dimitrilongo).
255
256
257**Perl**
258
259 * [MobileDetect.pm](https://www.buzzerstar.com/development/) is a Perl module for Mobile Detect.
260 Made by [Sebastian Enger](https://devop.tools/).
261
262**Python**
263
264* [pymobiledetect](https://pypi.python.org/pypi/pymobiledetect) - Mobile detect python package.
265Made by Bas van Oostveen.
266
267**Ruby**
268
269* [mobile_detect.rb](https://github.com/ktaragorn/mobile_detect) is a Ruby gem using the JSON data exposed by the
270php project and implementing a basic subset of the API (as much as can be done by the exposed data).
271Made by [Karthik T](https://github.com/ktaragorn).
272
273**Go**
274
275* [GoMobileDetect](https://github.com/Shaked/gomobiledetect) is a Go port of Mobile Detect class.
276Made by [https://github.com/Shaked](Shaked).
277
278
279**LUA**
280
281* [ua-lua](https://github.com/robinef/ua-lua) is a small lib written in LUA providing device type detection.
282ua-lua is detecting mobile or tablet devices based on user-agent inside nginx daemon.
283Made by [Frédéric Robinet](https://github.com/robinef).
284