Skip to content

Instantly share code, notes, and snippets.

@jawira
Created September 3, 2019 18:17
Show Gist options
  • Save jawira/cbb4870edf5fd71e948fec0e5d6036b8 to your computer and use it in GitHub Desktop.
Save jawira/cbb4870edf5fd71e948fec0e5d6036b8 to your computer and use it in GitHub Desktop.
Download and install Phive without wget nor curl
<?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