-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject_factory.php
More file actions
executable file
·37 lines (31 loc) · 1.02 KB
/
object_factory.php
File metadata and controls
executable file
·37 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/*
==============================================================
Copyright (C) 2014 Mark Vejvoda
Under GNU GPL v3.0
==============================================================
This is a class factory for Rip Runner class isntances
*/
namespace riprunner;
if ( defined('INCLUSION_PERMITTED') === false ||
(defined('INCLUSION_PERMITTED') === true && INCLUSION_PERMITTED === false)) {
die( 'This file must not be invoked directly.' );
}
require_once 'Mobile_Detect.php';
require_once 'logging.php';
/**
* Factory class to instantiate Mobile device detection class instances
*/
class MobileDetect_Factory {
public static function create($type, $param=null) {
if(isset($type) === false) {
throwExceptionAndLogError('No mobile type specified.', "Invalid mobile type specified [$type] param [$param]!");
}
switch($type) {
case 'browser_type':
return new \Mobile_Detect();
default:
throwExceptionAndLogError('Invalid mobile type specified.', "Invalid mobile type specified [$type] param [$param]!");
}
}
}