Exemple #1
0
 /**
  * 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());");
         }
     }
 }
Exemple #2
0
 /**
  * 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);
 }
 /**
  * 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();
 }
Exemple #4
0
 /**
  * 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);
 }