| 1 |
<?php |
| 2 |
/** |
| 3 |
* Little piece of PHP to make Mobile_Detect auto-loadable in PSR-0 compatible PHP autoloaders like |
| 4 |
* the Symfony Universal ClassLoader by Fabien Potencier. Since PSR-0 handles an underscore in |
| 5 |
* classnames (on the filesystem) as a slash, "Mobile_Detect.php" autoloaders will try to convert |
| 6 |
* the classname and path to "Mobile\Detect.php". This script will ensure autoloading with: |
| 7 |
* - Namespace: Detection |
| 8 |
* - Classname: MobileDetect |
| 9 |
* - Namespased: \Detection\MobileDetect |
| 10 |
* - Autoload path: ./namespaced |
| 11 |
* - Converted path: ./namespaced/Detection/MobileDetect.php |
| 12 |
* |
| 13 |
* Don't forget to use MobileDetect (instead of Mobile_Detect) as class in code when autoloading. |
| 14 |
* |
| 15 |
* Thanks to @WietseWind. |
| 16 |
* For details please check: https://github.com/serbanghita/Mobile-Detect/pull/120 |
| 17 |
*/ |
| 18 |
|
| 19 |
namespace Detection; |
| 20 |
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Mobile_Detect.php'; |
| 21 |
|
| 22 |
class MobileDetect extends \Mobile_Detect {} |
| 23 |
|