[wp-trac] [WordPress Trac] #57557: Switch copy_dir() with move_dir() in WP_Upgrader::install_package
WordPress Trac
noreply at wordpress.org
Thu Feb 2 22:59:16 UTC 2023
#57557: Switch copy_dir() with move_dir() in WP_Upgrader::install_package
-----------------------------+-----------------------------
Reporter: afragen | Owner: SergeyBiryukov
Type: enhancement | Status: accepted
Priority: normal | Milestone: 6.2
Component: Upgrade/Install | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses: performance
-----------------------------+-----------------------------
Comment (by costdev):
Sounds good!
If any issues are discovered with Language Pack upgrades during Beta and
we need to restrict `move_dir()` to just Plugins/Themes while we
investigate more, here's a snippet that will save us some time:
{{{#!php
<?php
// src/wp-admin/includes/class-wp-upgrader.php#L597
if ( isset( $args['hook_extra']['plugin'] ) || isset(
$args['hook_extra']['theme'] ) ) {
$result = move_dir( $source, $remote_destination, true );
} else {
$result = copy_dir( $source, $remote_destination );
}
}}}
Is this ticket ready to be added to the `commit` queue alongside the
related tickets?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57557#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list