Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append uniq id when extracting file from Phar #4692

Merged
merged 4 commits into from Feb 20, 2018

Conversation

3 participants
@danielbachhuber
Copy link
Member

danielbachhuber commented Feb 17, 2018

Fixes #4676

@danielbachhuber danielbachhuber added this to the 2.0.0 milestone Feb 17, 2018

@danielbachhuber danielbachhuber requested a review from wp-cli/committers Feb 17, 2018

@@ -24,7 +24,7 @@ function extract_from_phar( $path ) {
$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 );

This comment has been minimized.

@gitlost

gitlost Feb 19, 2018

Contributor

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.

This comment has been minimized.

@danielbachhuber

danielbachhuber Feb 19, 2018

Author Member

What about:

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

This comment has been minimized.

@gitlost

gitlost Feb 19, 2018

Contributor

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

This comment has been minimized.

@danielbachhuber

danielbachhuber Feb 19, 2018

Author Member

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"

danielbachhuber added some commits Feb 19, 2018

@gitlost

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

schlessera commented Feb 20, 2018

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@schlessera schlessera deleted the 4676-append-uniq-id branch Feb 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.