Files
interview-demo-code/scripts/ci/extract-phar.php

18 lines
343 B
PHP

<?php
$pharFile = $argv[1] ?? null;
$dstPath = $argv[2] ?? null;
if (! $dstPath) {
throw new InvalidArgumentException('Dst path must be provided');
}
if (! $pharFile) {
throw new InvalidArgumentException('Phar file must be provided');
}
$phar = new Phar($pharFile);
$phar->extractTo($dstPath);
echo "Phar extracted: $pharFile\n";