/** * Run WordPress Upgrade functions. * * {@internal Missing Long Description}} * * @since unknown * * @return null */ function wp_upgrade() { global $wp_current_db_version, $wp_db_version, $wpdb; $wp_current_db_version = __get_option('db_version'); // We are up-to-date. Nothing to do. if ($wp_db_version == $wp_current_db_version) { return; } if (!is_blog_installed()) { return; } wp_check_mysql_version(); wp_cache_flush(); pre_schema_upgrade(); make_db_current_silent(); upgrade_all(); if (is_multisite() && is_main_site()) { upgrade_network(); } wp_cache_flush(); if (is_multisite()) { if ($wpdb->get_row("SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = '{$wpdb->blogid}'")) { $wpdb->query("UPDATE {$wpdb->blog_versions} SET db_version = '{$wp_db_version}' WHERE blog_id = '{$wpdb->blogid}'"); } else { $wpdb->query("INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( '{$wpdb->blogid}', '{$wp_db_version}', NOW());"); } } }
switch($step) { case 0: $goback = attribute_escape(stripslashes(wp_get_referer())); ?> <p><?php _e('This file upgrades you from any previous version of WordPress to the latest. It may take a while though, so be patient.'); ?></p> <h2 class="step"><a href="upgrade.php?step=1&backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress »'); ?></a></h2> <?php break; case 1: $wp_current_db_version = __get_option('db_version'); if ( $wp_db_version != $wp_current_db_version ) { wp_cache_flush(); make_db_current_silent(); upgrade_all(); wp_cache_flush(); } if ( empty( $_GET['backto'] ) ) $backto = __get_option('home'); else $backto = attribute_escape(stripslashes($_GET['backto'])); ?> <h2><?php _e('Step 1'); ?></h2> <p><?php printf(__("There's actually only one step. So if you see this, you're done. <a href='%s'>Have fun</a>!"), $backto); ?></p> <!-- <pre> <?php printf(__('%s queries'), $wpdb->num_queries); ?>
/** * Run WordPress Upgrade functions. * * {@internal Missing Long Description}} * * @since unknown * * @return null */ function wp_upgrade() { global $wp_current_db_version, $wp_db_version; $wp_current_db_version = __get_option('db_version'); // We are up-to-date. Nothing to do. if ($wp_db_version == $wp_current_db_version) { return; } if (!is_blog_installed()) { return; } wp_check_mysql_version(); wp_cache_flush(); pre_schema_upgrade(); make_db_current_silent(); upgrade_all(); wp_cache_flush(); }
$htdocs_source = dirname(__FILE__) . "/htdocs/*"; $bin_source = dirname(__FILE__) . "/bin/*"; $agibin_source = dirname(__FILE__) . "/agi-bin/*"; if (!file_exists(dirname($htdocs_source))) { out(sprintf(_("No directory %s, install script not needed"), dirname($htdocs_source))); return true; } // These are required by libfreepbx.install.php library for upgrade routines // define("UPGRADE_DIR", dirname(__FILE__) . "/upgrades/"); define("MODULE_DIR", $amp_conf['AMPWEBROOT'] . '/modules/'); $htdocs_dest = $amp_conf['AMPWEBROOT']; $bin_dest = isset($amp_conf['AMPBIN']) ? $amp_conf['AMPBIN'] : '/var/lib/asterisk/bin'; $agibin_dest = isset($asterisk_conf['astagidir']) ? $asterisk_conf['astagidir'] : '/var/lib/asterisk/agi-bin'; exec("cp -rf {$htdocs_source} {$htdocs_dest} 2>&1", $out, $ret); if ($ret != 0) { framework_print_errors($htdocs_source, $htdocs_dest, $out); } exec("cp -rf {$bin_source} {$bin_dest} 2>&1", $out, $ret); if ($ret != 0) { framework_print_errors($bin_source, $bin_dest, $out); } exec("cp -rf {$agibin_source} {$agibin_dest} 2>&1", $out, $ret); if ($ret != 0) { framework_print_errors($agibin_source, $agibin_dest, $out); } if (function_exists('upgrade_all')) { upgrade_all(getversion()); } else { echo "[ERROR] Function: 'upgrade_all' not present, libfreepbx.install.php seems not to be installed<br>"; }
function wp_upgrade() { global $wp_current_db_version, $wp_db_version; $wp_current_db_version = __get_option('db_version'); // We are up-to-date. Nothing to do. if ( $wp_db_version == $wp_current_db_version ) return; wp_check_mysql_version(); wp_cache_flush(); make_db_current_silent(); upgrade_all(); wp_cache_flush(); }
/** * Runs HiveQueen Upgrade functions. * * Upgrades the database if needed during a site update. * * @since 0.0.1 * * @global int $hq_current_db_version * @global int $hq_db_version * @global hqdb $hqdb */ function hq_upgrade() { global $hq_current_db_version, $hq_db_version, $hqdb; $hq_current_db_version = __get_option('db_version'); // We are up-to-date. Nothing to do. if ($hq_db_version == $hq_current_db_version) { return; } if (!is_blog_installed()) { return; } hq_check_mysql_version(); hq_cache_flush(); pre_schema_upgrade(); // TODO: DEbug //make_db_current_silent(); make_db_current(); upgrade_all(); if (is_multisite() && is_main_site()) { upgrade_network(); } hq_cache_flush(); if (is_multisite()) { if ($hqdb->get_row("SELECT blog_id FROM {$hqdb->blog_versions} WHERE blog_id = '{$hqdb->blogid}'")) { $hqdb->query("UPDATE {$hqdb->blog_versions} SET db_version = '{$hq_db_version}' WHERE blog_id = '{$hqdb->blogid}'"); } else { $hqdb->query("INSERT INTO {$hqdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( '{$hqdb->blogid}', '{$hq_db_version}', NOW());"); } } /** * Fires after a site is fully upgraded. * * @since 0.0.1 * * @param int $hq_db_version The new $hq_db_version. * @param int $hq_current_db_version The old (current) $hq_db_version. */ do_action('hq_upgrade', $hq_db_version, $hq_current_db_version); }
/** * Runs WordPress Upgrade functions. * * Upgrades the database if needed during a site update. * * @since 2.1.0 * * @global int $wp_current_db_version * @global int $wp_db_version * @global wpdb $wpdb WordPress database abstraction object. */ function wp_upgrade() { global $wp_current_db_version, $wp_db_version, $wpdb; $wp_current_db_version = __get_option('db_version'); // We are up-to-date. Nothing to do. if ($wp_db_version == $wp_current_db_version) { return; } if (!is_blog_installed()) { return; } wp_cache_flush(); upgrade_all(); if (is_multisite() && is_main_site()) { upgrade_network(); } wp_cache_flush(); if (is_multisite()) { if ($wpdb->get_row("SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = '{$wpdb->blogid}'")) { $wpdb->query("UPDATE {$wpdb->blog_versions} SET db_version = '{$wp_db_version}' WHERE blog_id = '{$wpdb->blogid}'"); } else { $wpdb->query("INSERT INTO {$wpdb->blog_versions} ( [blog_id] , [db_version] , [last_updated] ) VALUES ( '{$wpdb->blogid}', '{$wp_db_version}', GETDATE());"); } } /** * Fires after a site is fully upgraded. * * @since 3.9.0 * * @param int $wp_db_version The new $wp_db_version. * @param int $wp_current_db_version The old (current) $wp_db_version. */ do_action('wp_upgrade', $wp_db_version, $wp_current_db_version); }
/** * Runs WordPress Upgrade functions. * * Upgrades the database if needed during a site update. * * @since 2.1.0 * * @global int $wp_current_db_version * @global int $wp_db_version * @global wpdb $wpdb WordPress database abstraction object. */ function wp_upgrade() { global $wp_current_db_version, $wp_db_version, $wpdb; $wp_current_db_version = __get_option('db_version'); // We are up-to-date. Nothing to do. if ($wp_db_version == $wp_current_db_version) { return; } if (!is_blog_installed()) { return; } wp_check_mysql_version(); wp_cache_flush(); pre_schema_upgrade(); make_db_current_silent(); upgrade_all(); wp_cache_flush(); /** * Fires after a site is fully upgraded. * * @since 3.9.0 * * @param int $wp_db_version The new $wp_db_version. * @param int $wp_current_db_version The old (current) $wp_db_version. */ do_action('wp_upgrade', $wp_db_version, $wp_current_db_version); }