Upgrade/Install: Check that WordPress is installed before scheduling cleanup of the temp-backup directory.

Trying to schedule cron jobs before WordPress is installed results in DB errors, which is suboptimal.

This addresses a  `Table 'wp_options' doesn't exist` error when running the installation with `WP_DEBUG` enabled.

Follow-up to [51815], [51898], [51899], [51902], [52192].

Props dlh, pbiron.
See #51857.

git-svn-id: https://develop.svn.wordpress.org/trunk@52284 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-11-30 17:10:19 +00:00
parent db8df6b8e8
commit db674cc338

View File

@ -141,7 +141,10 @@ class WP_Upgrader {
public function init() {
$this->skin->set_upgrader( $this );
$this->generic_strings();
$this->schedule_temp_backup_cleanup();
if ( ! wp_installing() ) {
$this->schedule_temp_backup_cleanup();
}
}
/**