Conditions | 4 |
Paths | 10 |
Total Lines | 17 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public static function create($conf, $commandLineObject=null) |
||
28 | { |
||
29 | $name=$conf["name"]; |
||
30 | $crawlerProvider="Crawler"; |
||
31 | try { |
||
32 | $BabelConfig=json_decode(file_get_contents(babel_path("Extension/$name/babel.json")), true); |
||
33 | $crawlerProvider=$BabelConfig["provider"]["crawler"]; |
||
34 | } catch (ErrorException $e) { |
||
35 | } catch (Exception $e) { |
||
36 | } |
||
37 | $className="App\\Babel\\Extension\\$name\\$crawlerProvider"; |
||
38 | if (class_exists($className)) { |
||
39 | $temp=new $className(); |
||
40 | $temp->importCommandLine($commandLineObject); |
||
41 | return $temp; |
||
42 | } else { |
||
43 | return null; |
||
44 | } |
||
47 |