当前位置: 首页>>代码示例>>PHP>>正文


PHP upgrade_network函数代码示例

本文整理汇总了PHP中upgrade_network函数的典型用法代码示例。如果您正苦于以下问题:PHP upgrade_network函数的具体用法?PHP upgrade_network怎么用?PHP upgrade_network使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了upgrade_network函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: hq_upgrade

 /**
  * 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);
 }
开发者ID:gcorral,项目名称:hivequeen,代码行数:50,代码来源:upgrade.php

示例2: wp_upgrade

 /**
  * 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());");
         }
     }
 }
开发者ID:beaucollins,项目名称:wp,代码行数:37,代码来源:upgrade.php

示例3: wp_upgrade

 /**
  * 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);
 }
开发者ID:leonardopires,项目名称:projectnami,代码行数:45,代码来源:upgrade.php


注:本文中的upgrade_network函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。