Skip to content

Conversation

@danielbachhuber
Copy link
Member

Fixes #4676

php/utils.php Outdated
$fname = basename( $path );

$tmp_path = get_temp_dir() . "wp-cli-$fname";
$tmp_path = get_temp_dir() . "wp-cli-$fname-" . uniqid( 'wp-cli-extract-from-phar-', true );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to do this as

get_temp_dir() . uniqid( "wp-cli-extract-from-phar-", true ) . "-$fname";

to keep the extension the same.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about:

get_temp_dir() . 'wp-cli-' . uniqid( "wp-cli-extract-from-phar-", true ) . "-$fname";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wp-cli- bit though is covered by the arg to uniqid()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see:

local ➜  wordpress-develop git:(master) wp shell
wp> $fname = 'router.php';
=> string(10) "router.php"
wp> 'wp-cli-' . uniqid( "wp-cli-extract-from-phar-", true ) . "-$fname";
=> string(66) "wp-cli-wp-cli-extract-from-phar-5a8b0566008283.78459585-router.php"

@gitlost
Copy link
Contributor

gitlost commented Feb 19, 2018

Ok this is failing due to #4613, and this check in CLI_Command::update() at CLI_Command.php#L325 for WP-CLI version: (note colon at end). Which answers this question #4613 (comment)

I wonder if people use the output from wp cli info for scripting purposes.

with "Yes! We do!".

Probably better to revert #4613 than to modify the check...?

@schlessera
Copy link
Member

Our own break can be fixed either way. Let's discuss reverting during office hours today.

@schlessera schlessera merged commit 0ab54a5 into master Feb 20, 2018
@schlessera schlessera deleted the 4676-append-uniq-id branch February 20, 2018 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants