Created
September 3, 2019 18:17
-
-
Save jawira/cbb4870edf5fd71e948fec0e5d6036b8 to your computer and use it in GitHub Desktop.
Download and install Phive without wget nor curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Download and install Phive without wget nor curl | |
* | |
* Very useful for CI when using alpine images. However you will need to run | |
* `apk add ncurses` in order to execute Phive. | |
* | |
* If you want to run this with "php -r" you should first escape all '$' signs. | |
* | |
* @author Jawira Portugal <[email protected]> | |
*/ | |
$f = '/usr/local/bin/phive'; | |
touch($f); | |
file_put_contents($f, file_get_contents('https://phar.io/releases/phive.phar')); | |
chmod($f, 0775); | |
// Same as one-liner | |
// php -r "\$f='/usr/local/bin/phive';touch(\$f);file_put_contents(\$f,file_get_contents('https://phar.io/releases/phive.phar'));chmod(\$f,0775);" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment