Create a gist now

Instantly share code, notes, and snippets.

@dyntopia /phar.php Secret
Created Jun 3, 2016

What would you like to do?
<?php
if ($argc < 3) {
echo "ERROR: $argv[0] dst src\n";
exit(1);
}
if (is_dir($argv[1]) !== TRUE) {
mkdir($argv[1]) or die("aborting...\n");
}
for ($i = 2; $i < $argc; $i++) {
try {
$phar = new PharData($argv[$i]);
$phar->extractTo($argv[1]);
} catch (Exception $e) {
echo "NOTE: " . $e->getMessage() . "\n";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment