Conditions | 5 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | public static function getOcraService($type="tiqr", $options=array()) |
||
40 | { |
||
41 | switch ($type) { |
||
42 | case "tiqr": |
||
43 | require_once("Tiqr/OcraService/Tiqr.php"); |
||
44 | $instance = new Tiqr_OcraService_Tiqr($options); |
||
45 | break; |
||
46 | case "oathserviceclient": |
||
47 | require_once("Tiqr/OcraService/OathServiceClient.php"); |
||
48 | $instance = new Tiqr_OcraService_OathServiceClient($options); |
||
49 | break; |
||
50 | default: |
||
51 | if (!isset($type)) { |
||
52 | throw new Exception('Class name not set'); |
||
53 | } elseif (!class_exists($type)) { |
||
54 | throw new Exception('Class not found: ' . var_export($type, TRUE)); |
||
55 | } |
||
56 | $instance = new $type($options); |
||
57 | } |
||
58 | |||
59 | return $instance; |
||
60 | } |
||
62 |