<?php
-// php -dphar.readonly=0 utils/make-phar.php [--quiet]
+if ( !isset( $argv[1] ) ) {
+ echo "usage: php -dphar.readonly=0 $argv[0] <path> [--quiet]\n";
+ exit(1);
+}
+
+define( 'DEST_PATH', $argv[1] );
-define( 'BE_QUIET', isset( $argv[1] ) && '--quiet' == $argv[1] );
+define( 'BE_QUIET', in_array( '--quiet', $argv ) );
function get_iterator( $dir ) {
return new \RecursiveIteratorIterator(
$phar[ $key ] = file_get_contents( $path );
}
-$phar = new Phar( 'wp-cli.phar', 0, 'wp-cli.phar' );
+$phar = new Phar( DEST_PATH, 0, 'wp-cli.phar' );
$phar->startBuffering();
$phar->stopBuffering();
-echo "Generated wp-cli.phar.\n";
+echo "\nGenerated " . DEST_PATH . "\n";