wp-cli/wp-cli#6374 added Utils\make_temp_file() and Utils\make_temp_dir() (merged to main, milestone 3.0.0). This package still builds temporary paths by hand:
src/Core_Command.php:301: Utils\get_temp_dir() . uniqid( 'wp_' ) . '.tmp'
src/Core_Command.php:2245: Utils\get_temp_dir() . uniqid( 'wp_' ) . '.zip'
src/WP_CLI/Core/CoreUpgrader.php:87: Utils\get_temp_dir() . uniqid( 'wp_' ) . ".{$extension}"
Switch them to Utils\make_temp_file( 'wp_', '.tmp' ), Utils\make_temp_file( 'wp_', '.zip' ) and Utils\make_temp_file( 'wp_', ".{$extension}" ). The helper creates the file up front with mode 0600 and errors out instead of handing back a path that might already exist. The shutdown-function cleanup at each site stays as it is.
Blocked on a wp-cli/wp-cli release that ships the helpers. composer.json already requires wp-cli/wp-cli ^3.0.
wp-cli/wp-cli#6374 added
Utils\make_temp_file()andUtils\make_temp_dir()(merged to main, milestone 3.0.0). This package still builds temporary paths by hand:src/Core_Command.php:301:Utils\get_temp_dir() . uniqid( 'wp_' ) . '.tmp'src/Core_Command.php:2245:Utils\get_temp_dir() . uniqid( 'wp_' ) . '.zip'src/WP_CLI/Core/CoreUpgrader.php:87:Utils\get_temp_dir() . uniqid( 'wp_' ) . ".{$extension}"Switch them to
Utils\make_temp_file( 'wp_', '.tmp' ),Utils\make_temp_file( 'wp_', '.zip' )andUtils\make_temp_file( 'wp_', ".{$extension}" ). The helper creates the file up front with mode 0600 and errors out instead of handing back a path that might already exist. The shutdown-function cleanup at each site stays as it is.Blocked on a wp-cli/wp-cli release that ships the helpers.
composer.jsonalready requireswp-cli/wp-cli ^3.0.