GinoPane /
php-nano-rest
| 1 | <?php |
||
| 2 | |||
| 3 | $cacertUrl = "https://curl.haxx.se/ca/cacert.pem"; |
||
| 4 | |||
| 5 | echo "Trying to update cacert.pem\n"; |
||
| 6 | |||
| 7 | $updated = @file_get_contents($cacertUrl); |
||
| 8 | |||
| 9 | if ($updated === false) { |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 10 | echo "Failed to download the cacert.pem"; |
||
| 11 | exit(1); |
||
| 12 | } |
||
| 13 | |||
| 14 | if (false === file_put_contents(dirname(__FILE__, 2) . "/cacert.pem", $updated)) { |
||
| 15 | echo "Failed to store the downloaded cacert.pem"; |
||
| 16 | exit(1); |
||
| 17 | }; |
||
| 18 | |||
| 19 | echo "The cacert.pem was updated successfully\n"; |
||
| 20 | |||
| 21 | exit(0); |
||
| 22 |