| Total Lines | 17 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | "callback" => function () { |
||
| 11 | $weatherProg = new \Hepa19\Weather\WeatherModel(); |
||
| 12 | $curl = new \Hepa19\Curl\Curl(); |
||
| 13 | $cfg = $this->get("configuration"); |
||
|
|
|||
| 14 | |||
| 15 | if (file_exists(ANAX_INSTALL_PATH . "/config/api_weatherprog_config.php")) { |
||
| 16 | $config = $cfg->load("api_weatherprog_config.php"); |
||
| 17 | $key = $config["config"]["apiKey"] ?? null; |
||
| 18 | $baseUrl = $config["config"]["baseUrl"] ?? null; |
||
| 19 | $options = $config["config"]["options"] ?? null; |
||
| 20 | $weatherProg->setCurl($curl); |
||
| 21 | $weatherProg->setApiKey($key); |
||
| 22 | $weatherProg->setBaseUrl($baseUrl); |
||
| 23 | $weatherProg->setUrlOptions($options); |
||
| 24 | } |
||
| 25 | |||
| 26 | return $weatherProg; |
||
| 27 | } |
||
| 31 |