OSDN Git Service

remove support for Phar archive
authorscribu <mail@scribu.net>
Wed, 8 May 2013 21:08:37 +0000 (00:08 +0300)
committerscribu <mail@scribu.net>
Fri, 21 Jun 2013 09:36:47 +0000 (12:36 +0300)
php/boot-phar.php [deleted file]
php/commands/help.php
utils/make-phar.php [deleted file]
utils/test-phar-download [deleted file]
utils/update-phar [deleted file]

diff --git a/php/boot-phar.php b/php/boot-phar.php
deleted file mode 100644 (file)
index be8cfdc..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-define( 'WP_CLI_ROOT', 'phar://wp-cli.phar/php/' );
-
-include WP_CLI_ROOT . 'wp-cli.php';
-
index ef8b24b..a15ecc2 100644 (file)
@@ -67,7 +67,7 @@ class Help_Command extends WP_CLI_Command {
                        $man_path = "$dest_dir/" . $man_file;
 
                        if ( is_readable( $man_path ) ) {
-                               self::show_manpage( $man_path );
+                               \WP_CLI::launch( "man $man_path" );
                                return true;
                        }
                }
@@ -75,17 +75,6 @@ class Help_Command extends WP_CLI_Command {
                return false;
        }
 
-       private static function show_manpage( $path ) {
-               // man can't read phar://, so need to copy to a temporary file
-               $tmp_path = tempnam( sys_get_temp_dir(), 'wp-cli-man-' );
-
-               copy( $path, $tmp_path );
-
-               \WP_CLI::launch( "man $tmp_path" );
-
-               unlink( $tmp_path );
-       }
-
        private static function _generate( $src_dir, $dest_dir, $command ) {
                $cmd_path = Dispatcher\get_path( $command );
                array_shift( $cmd_path ); // discard 'wp'
diff --git a/utils/make-phar.php b/utils/make-phar.php
deleted file mode 100644 (file)
index 1911b8f..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-
-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', in_array( '--quiet', $argv ) );
-
-function get_iterator( $dir ) {
-       return new \RecursiveIteratorIterator(
-               new \RecursiveDirectoryIterator( $dir, FilesystemIterator::SKIP_DOTS )
-       );
-}
-
-function add_file( $phar, $path ) {
-       $key = str_replace( './', '', $path );
-
-       if ( !BE_QUIET )
-               echo "$key - $path\n";
-
-       $phar[ $key ] = file_get_contents( $path );
-}
-
-$phar = new Phar( DEST_PATH, 0, 'wp-cli.phar' );
-
-$phar->startBuffering();
-
-// php files
-foreach ( get_iterator( './php' ) as $path ) {
-       if ( !preg_match( '/\.php$/', $path ) )
-               continue;
-
-       add_file( $phar, $path );
-}
-
-// non-php files
-$additional_dirs = array(
-       './templates',
-       './man'
-);
-
-foreach ( $additional_dirs as $dir ) {
-       foreach ( get_iterator( $dir ) as $path ) {
-               add_file( $phar, $path );
-       }
-}
-
-// dependencies
-$ignored_paths = array(
-       '/.git',
-);
-
-$vendor_dirs = array(
-       './vendor/mustache',
-       './vendor/wp-cli',
-       './vendor/composer',
-);
-
-foreach ( $vendor_dirs as $vendor_dir ) {
-       foreach ( get_iterator( $vendor_dir ) as $path ) {
-               foreach ( $ignored_paths as $ignore ) {
-                       if ( strpos( $path, $ignore ) )
-                               continue 2;
-               }
-
-               add_file( $phar, $path );
-       }
-}
-
-add_file( $phar, './vendor/autoload.php' );
-
-$phar->setStub( <<<EOB
-#!/usr/bin/env php
-<?php
-Phar::mapPhar();
-include 'phar://wp-cli.phar/php/boot-phar.php';
-__HALT_COMPILER();
-?>
-EOB
-);
-
-$phar->stopBuffering();
-
-echo "Generated " . DEST_PATH . "\n";
-
diff --git a/utils/test-phar-download b/utils/test-phar-download
deleted file mode 100755 (executable)
index f1a47e5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env bash
-
-actual_checksum=$(curl http://wp-cli.org/packages/phar/wp-cli.phar | md5sum | cut -d ' ' -f 1)
-
-echo "expected:" $(curl -s http://wp-cli.org/packages/phar/wp-cli.phar.md5)
-echo "actual:  " $actual_checksum
diff --git a/utils/update-phar b/utils/update-phar
deleted file mode 100755 (executable)
index ea79bf1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env bash
-
-set -ex
-
-current_rev=$(git rev-parse HEAD)
-current_rev=${current_rev:0:10}
-
-packages_repo=../wp-cli-packages
-
-fname="phar/wp-cli.phar"
-
-# generate archive
-php -dphar.readonly=0 ./utils/make-phar.php $packages_repo/$fname --quiet
-
-cd $packages_repo
-
-# smoke test
-php $fname --version
-
-# check which wp-cli commit the previous Phar archive was based on
-# can't use the md5 hash, since it will be different each time the
-# archive is generated
-new_commit_subj="update wp-cli.phar to wp-cli/wp-cli@$current_rev"
-
-current_commit_subj=$(git show -s --pretty=format:%s HEAD)
-
-if [ "$new_commit_subj" = "$current_commit_subj" ]; then
-       echo "already at latest revision"
-       exit 1
-fi
-
-# generate md5 checksum
-if [ command -v md5sum > /dev/null ]
-then
-       md5hash=$(md5sum $fname)
-else
-       md5hash=$(md5 -r $fname)
-fi
-
-echo $md5hash | cut -d ' ' -f 1 > $fname.md5
-
-git add $fname $fname.md5
-
-git commit -m "$new_commit_subj"
-
-git push