Conditions | 2 |
Paths | 8 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 6 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | public function download($url) |
||
8 | { |
||
9 | // Todo: refactor and include in configuration |
||
10 | $pathExec = "/usr/local/bin"; |
||
11 | try { |
||
12 | $content = file_get_contents($url); |
||
13 | file_put_contents($pathExec."/newdep", $content); |
||
14 | unlink($pathExec.'/dep'); |
||
15 | $content = file_get_contents($pathExec."/newdep"); |
||
16 | file_put_contents($pathExec."/dep", $content); |
||
17 | unlink($pathExec.'/newdep'); |
||
18 | chmod($pathExec."/dep",0755); |
||
19 | } catch (\Exception $e){ |
||
20 | return false; |
||
21 | } |
||
22 | |||
23 | return true; |
||
24 | } |
||
25 | } |