| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.072 |
| Changes | 3 | ||
| Bugs | 2 | Features | 1 |
| 1 | <?php |
||
| 16 | 78 | public function sync($type = 'xml') |
|
| 17 | { |
||
| 18 | 78 | $translations = (array) $this->config->get('translations'); |
|
| 19 | |||
| 20 | // Download quran data |
||
| 21 | 78 | foreach ($translations as $tr) { |
|
| 22 | 78 | $file = $this->config->get('storage_path').'/'.$tr.'.'.$type; |
|
| 23 | |||
| 24 | 78 | if (!file_exists($file)) { |
|
| 25 | $url = 'http://tanzil.net/trans/?transID='.$tr.'&type='.$type; |
||
| 26 | 26 | $this->download($url, $file); |
|
| 27 | } |
||
| 28 | 52 | } |
|
| 29 | 78 | } |
|
| 30 | |||
| 38 |