本文整理汇总了PHP中upgrade_all函数的典型用法代码示例。如果您正苦于以下问题:PHP upgrade_all函数的具体用法?PHP upgrade_all怎么用?PHP upgrade_all使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了upgrade_all函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());");
}
}
}
示例2: switch
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); ?>
示例3: 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;
$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();
}
示例4: dirname
$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>";
}
示例5: wp_upgrade
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();
}
示例6: 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);
}
示例7: 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);
}
示例8: 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_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);
}