Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public static function getWebAccess(?string $url = null): WebAccess |
||
20 | { |
||
21 | // Local file |
||
22 | if (! empty($url) && $url[0] === '/') { |
||
23 | return new WebAccessLocal(); |
||
24 | } |
||
25 | |||
26 | // Default for remote: cURL |
||
27 | if (function_exists('curl_init')) { |
||
28 | return new WebAccessCUrl(); |
||
29 | } |
||
30 | |||
31 | // Fallback |
||
32 | return new WebAccessPHP(); |
||
33 | } |
||
35 |