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 one temporary path by hand:
src/WP_CLI/LanguagePackUpgrader.php:102: \WP_CLI\Utils\get_temp_dir() . uniqid( 'wp_' ) . '.' . $ext
Switch it to \WP_CLI\Utils\make_temp_file( 'wp_', '.' . $ext ). The path is only used on the cache-hit branch (copy( $cache_file, $temp )); on a cache miss download_url() replaces it. Since the helper creates the file, call it inside the cache-hit branch, otherwise every cache miss leaves an empty file behind.
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 one temporary path by hand:src/WP_CLI/LanguagePackUpgrader.php:102:\WP_CLI\Utils\get_temp_dir() . uniqid( 'wp_' ) . '.' . $extSwitch it to
\WP_CLI\Utils\make_temp_file( 'wp_', '.' . $ext ). The path is only used on the cache-hit branch (copy( $cache_file, $temp )); on a cache missdownload_url()replaces it. Since the helper creates the file, call it inside the cache-hit branch, otherwise every cache miss leaves an empty file behind.Blocked on a wp-cli/wp-cli release that ships the helpers.
composer.jsonalready requireswp-cli/wp-cli ^3.0.