本文整理汇总了PHP中wp_upgrade函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_upgrade函数的具体用法?PHP wp_upgrade怎么用?PHP wp_upgrade使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_upgrade函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _e
_e('The update process may take a little while, so please be patient.');
?>
</p>
<p class="step"><a class="button button-large"
href="upgrade.php?step=1&backto=<?php
echo $goback;
?>
"><?php
_e('Update WordPress Database');
?>
</a>
</p>
<?php
break;
case 1:
wp_upgrade();
$backto = !empty($_GET['backto']) ? wp_unslash(urldecode($_GET['backto'])) : __get_option('home') . '/';
$backto = esc_url($backto);
$backto = wp_validate_redirect($backto, __get_option('home') . '/');
?>
<h2><?php
_e('Update Complete');
?>
</h2>
<p><?php
_e('Your WordPress database has been successfully updated!');
?>
</p>
<p class="step"><a class="button button-large" href="<?php
echo $backto;
?>
开发者ID:richardbota,项目名称:WordPress-Theme-Development-with-Bootstrap,代码行数:31,代码来源:upgrade.php
示例2: update_db
/**
* Update the WordPress database.
*
* @subcommand update-db
*/
function update_db()
{
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
wp_upgrade();
WP_CLI::success('WordPress database upgraded successfully.');
}
开发者ID:wturrell,项目名称:wp-cli,代码行数:11,代码来源:core.php
示例3: update_db
/**
* Update the WordPress database.
*
* [--network]
* : Update databases for all sites on a network
*
* [--dry-run]
* : Compare database versions without performing the update.
*
* @subcommand update-db
*/
function update_db($_, $assoc_args)
{
global $wpdb, $wp_db_version, $wp_current_db_version;
$network = Utils\get_flag_value($assoc_args, 'network');
if ($network && !is_multisite()) {
WP_CLI::error('This is not a multisite install.');
}
$dry_run = Utils\get_flag_value($assoc_args, 'dry-run');
if ($dry_run) {
WP_CLI::log('Performing a dry run, with no database modification.');
}
if ($network) {
$iterator_args = array('table' => $wpdb->blogs, 'where' => array('spam' => 0, 'deleted' => 0, 'archived' => 0));
$it = new \WP_CLI\Iterators\Table($iterator_args);
$success = $total = 0;
foreach ($it as $blog) {
$total++;
$url = $blog->domain . $blog->path;
$process = WP_CLI::launch_self('core update-db', array(), array(), false, true, array('url' => $url, 'dry-run' => $dry_run));
if (0 == $process->return_code) {
// See if we can parse the stdout
if (preg_match('#Success: (.+)#', $process->stdout, $matches)) {
$message = "{$matches[1]} on {$url}";
} else {
$message = "Database upgraded successfully on {$url}";
}
WP_CLI::log($message);
$success++;
} else {
WP_CLI::warning("Database failed to upgrade on {$url}");
}
}
if (!$dry_run && $total && $success == $total) {
update_site_option('wpmu_upgrade_site', $wp_db_version);
}
WP_CLI::success(sprintf('WordPress database upgraded on %d/%d sites', $success, $total));
} else {
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
$wp_current_db_version = __get_option('db_version');
if ($wp_db_version != $wp_current_db_version) {
if (!$dry_run) {
wp_upgrade();
}
WP_CLI::success("WordPress database upgraded successfully from db version {$wp_current_db_version} to {$wp_db_version}");
} else {
WP_CLI::success("WordPress database already at latest db version {$wp_db_version}");
}
}
}
开发者ID:Faisalawanisee,项目名称:wp-cli,代码行数:60,代码来源:core.php
示例4: upgradeWordpressDB
public static function upgradeWordpressDB(Event $e)
{
$io = $e->getIO();
$_SERVER = array("HTTP_HOST" => 'localhost', "SCRIPT_FILENAME" => realpath(__DIR__ . '/../../../web/wp/wp-admin/includes/upgrade.php'), "SCRIPT_NAME" => '/wp/wp-admin/includes/upgrade.php', "PHP_SELF" => '/wp/wp-admin/includes/upgrade.php', "REQUEST_URI" => "/", "REQUEST_METHOD" => "GET");
include_once __DIR__ . '/../../../web/wp/wp-load.php';
include_once __DIR__ . '/../../../web/wp/wp-admin/includes/upgrade.php';
$io->write('<info>Starting to upgrade WordPress Database</info>');
try {
\wp_upgrade();
} catch (\Exception $e) {
$io->write('<error>Unable to upgrade wordpress</error>');
return;
}
$io->write('<info>WordPress Upgrade Complete!</info>');
}
开发者ID:mindgruve,项目名称:mg-press,代码行数:15,代码来源:ComposerScripts.php
示例5: import_data_action
//.........这里部分代码省略.........
// Store demo assets for download later
$demo_assets[$match[0]] = array();
}
} elseif (preg_match('/-(\\d+x\\d+)\\.[a-z0-9]{3,4}$/i', $match[3], $m)) {
$origin = preg_replace('/-(\\d+x\\d+)(\\.[a-z0-9]{3,4})$/i', '\\2', $match[0]);
if (!isset($demo_assets[$origin])) {
$demo_assets[$origin] = array();
}
if (!in_array($m[1], $demo_assets[$origin])) {
$demo_assets[$origin][] = $m[1];
}
}
}
// Update query with new asset URL
$query = str_replace($match[0], $upload['baseurl'] . $match[3], $query);
}
}
// Check if query contains serialization string
if (preg_match('/a:\\d+:\\{/', $query)) {
$parts = explode('";', $query);
$query = '';
$i = 0;
$n = count($parts);
// Define call-back function
if (!function_exists('woorockets_sample_data_installer_replace_callback')) {
function woorockets_sample_data_installer_replace_callback($m)
{
return $m[1] . strlen($m[4]) . $m[3] . $m[4] . $m[5];
}
}
foreach ($parts as $part) {
if (++$i < $n) {
$part .= '";';
}
if (preg_match('/^(.*)(s:\\d+:\\\\?".+\\\\?";)(.*)$/', $part, $match)) {
$match[2] = str_replace(array('\\r', '\\n', "\\'", '\\"'), array('', '', "'", '"'), $match[2]);
$match[2] = preg_replace_callback('/(s:)(\\d+)(:")(.*)(";)/', 'woorockets_sample_data_installer_replace_callback', $match[2]);
$part = $match[1] . str_replace(array("'", '"'), array("\\'", '\\"'), $match[2]) . $match[3];
}
$query .= $part;
}
}
// Execute query
ob_start();
if (false === $wpdb->query($query)) {
$error = ob_get_contents();
throw new Exception(sprintf(__('Sample data import has encountered an error and cannot continue: %s', 'ferado'), empty($error) ? $query : $error));
}
ob_end_clean();
}
}
}
// Make sure database is up-to-date with current WordPress version
if (!function_exists('wp_upgrade')) {
include ABSPATH . 'wp-admin/includes/upgrade.php';
}
wp_upgrade();
// Restore session tokens for current user
if ($session_tokens) {
update_user_meta(get_current_user_id(), 'session_tokens', $session_tokens);
}
// Create database backup file if necessary
if (count($backups)) {
$backups = implode("\n", $backups);
// Get details about upload directory
$path = isset($upload) ? $upload : wp_upload_dir();
if ($path = $this->_prepare_directory($path['basedir'] . '/' . $this->id . '/backup')) {
// Generate backup file path
$path = $path . '/' . date('Y-m-d H-i-s') . '.sql';
// Write database backup to file
$this->_write_file($path, $backups);
}
}
// Clean-up temporary file/directory left by sample data installation process
$this->_clean_temporary_data();
// Prepare installation results
$path = isset($upload) ? $upload : wp_upload_dir();
$path = $this->_prepare_directory($path['basedir'] . '/' . $this->id);
foreach (array('installed_plugins', 'demo_assets') as $type) {
if (isset(${$type})) {
// Write installation results to file
$this->_write_file($path . '/' . $type . '.json', json_encode(${$type}));
}
}
// Prepare response
$response = null;
if (isset($skipped_plugins)) {
$response['skipped_plugins'] = $skipped_plugins;
}
if (isset($demo_assets)) {
// Set demo assets to reponse
foreach (array_keys($demo_assets) as $asset) {
$response['demo_assets'][] = basename($asset);
}
}
return $response;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:JaneJieYing,项目名称:HiFridays,代码行数:101,代码来源:sample-data-installer.php
示例6: updateDatabase
function updateDatabase()
{
if (!current_user_can('manage_options')) {
echo 'Oops sorry you are not authorized to do this';
return false;
}
$this->logMessage('Updating your wordpress database');
require_once ABSPATH . '/wp-admin/upgrade-functions.php';
if (get_option('db_version') == $wp_db_version) {
$this->logMessage('Everything seems to be upgraded. No need to update the database<br />');
return true;
} else {
wp_upgrade();
$this->logMessage('The wordpress database was succesfully upgraded to the latest version ' . get_option('db_version') . '<br />');
return true;
}
return true;
}
开发者ID:julianbonilla,项目名称:three20.info,代码行数:18,代码来源:wpau_upgrade.class.php
示例7: mmb_parse_request
function mmb_parse_request()
{
global $mmb_core, $wp_db_version, $_wp_using_ext_object_cache, $_mwp_data, $_mwp_auth;
$_wp_using_ext_object_cache = false;
@set_time_limit(1200);
if (isset($_mwp_data['setting'])) {
if (array_key_exists("dataown", $_mwp_data['setting'])) {
$oldconfiguration = array("dataown" => $_mwp_data['setting']['dataown']);
$mmb_core->save_options($oldconfiguration);
unset($_mwp_data['setting']['dataown']);
}
$configurationService = new MWP_Configuration_Service();
$configuration = new MWP_Configuration_Conf($_mwp_data['setting']);
$configurationService->saveConfiguration($configuration);
}
if ($_mwp_data['action'] === 'add_site') {
mmb_add_site($_mwp_data['params']);
mmb_response('You should never see this.', false);
}
/* in case database upgrade required, do database backup and perform upgrade ( wordpress wp_upgrade() function ) */
if (strlen(trim($wp_db_version)) && !defined('ACX_PLUGIN_DIR')) {
if (get_option('db_version') != $wp_db_version) {
/* in multisite network, please update database manualy */
if (!is_multisite()) {
if (!function_exists('wp_upgrade')) {
include_once ABSPATH . 'wp-admin/includes/upgrade.php';
}
ob_clean();
@wp_upgrade();
@do_action('after_db_upgrade');
ob_end_clean();
}
}
}
if (isset($_mwp_data['params']['secure'])) {
if (is_array($_mwp_data['params']['secure'])) {
$secureParams = $_mwp_data['params']['secure'];
foreach ($secureParams as $key => $value) {
$secureParams[$key] = base64_decode($value);
}
$_mwp_data['params']['secure'] = $secureParams;
} else {
$_mwp_data['params']['secure'] = base64_decode($_mwp_data['params']['secure']);
}
if ($decrypted = $mmb_core->_secure_data($_mwp_data['params']['secure'])) {
$decrypted = maybe_unserialize($decrypted);
if (is_array($decrypted)) {
foreach ($decrypted as $key => $val) {
if (!is_numeric($key)) {
$_mwp_data['params'][$key] = $val;
}
}
unset($_mwp_data['params']['secure']);
} else {
$_mwp_data['params']['secure'] = $decrypted;
}
}
if (!$decrypted && $mmb_core->get_random_signature() !== false) {
require_once dirname(__FILE__) . '/src/PHPSecLib/Crypt/AES.php';
$cipher = new Crypt_AES(CRYPT_AES_MODE_ECB);
$cipher->setKey($mmb_core->get_random_signature());
$decrypted = $cipher->decrypt($_mwp_data['params']['secure']);
$_mwp_data['params']['account_info'] = json_decode($decrypted, true);
}
}
$logData = array('action' => $_mwp_data['action'], 'action_parameters' => $_mwp_data['params'], 'action_settings' => $_mwp_data['setting']);
if (!empty($_mwp_data['setting'])) {
$logData['settings'] = $_mwp_data['setting'];
}
mwp_logger()->debug('Master request: "{action}"', $logData);
}
开发者ID:tconte252,项目名称:haute-inhabit,代码行数:71,代码来源:functions.php
示例8: iwp_mmb_parse_request
function iwp_mmb_parse_request()
{
global $HTTP_RAW_POST_DATA;
$HTTP_RAW_POST_DATA_LOCAL = NULL;
$HTTP_RAW_POST_DATA_LOCAL = file_get_contents('php://input');
if (empty($HTTP_RAW_POST_DATA_LOCAL)) {
if (isset($HTTP_RAW_POST_DATA)) {
$HTTP_RAW_POST_DATA_LOCAL = $HTTP_RAW_POST_DATA;
}
}
ob_start();
global $current_user, $iwp_mmb_core, $new_actions, $wp_db_version, $wpmu_version, $_wp_using_ext_object_cache;
$data = base64_decode($HTTP_RAW_POST_DATA_LOCAL);
if ($data) {
//$num = @extract(unserialize($data));
$unserialized_data = @unserialize($data);
if (isset($unserialized_data['params'])) {
$unserialized_data['params'] = iwp_mmb_filter_params($unserialized_data['params']);
}
$iwp_action = $unserialized_data['iwp_action'];
$params = $unserialized_data['params'];
$id = $unserialized_data['id'];
$signature = $unserialized_data['signature'];
}
if (isset($iwp_action)) {
if (!defined('IWP_AUTHORISED_CALL')) {
define('IWP_AUTHORISED_CALL', 1);
}
if (function_exists('register_shutdown_function')) {
register_shutdown_function("iwp_mmb_shutdown");
}
$GLOBALS['IWP_MMB_PROFILING']['ACTION_START'] = microtime(1);
error_reporting(E_ALL ^ E_NOTICE);
@ini_set("display_errors", 1);
iwp_mmb_create_backup_table();
run_hash_change_process();
$action = $iwp_action;
$_wp_using_ext_object_cache = false;
@set_time_limit(600);
if (!$iwp_mmb_core->check_if_user_exists($params['username'])) {
iwp_mmb_response(array('error' => 'Username <b>' . $params['username'] . '</b> does not have administrative access. Enter the correct username in the site options.', 'error_code' => 'username_does_not_have_administrative_access'), false);
}
if ($action == 'add_site') {
iwp_mmb_add_site($params);
iwp_mmb_response(array('error' => 'You should never see this.', 'error_code' => 'you_should_never_see_this'), false);
}
if ($action == 'readd_site') {
$params['id'] = $id;
$params['signature'] = $signature;
iwp_mmb_readd_site($params);
iwp_mmb_response(array('error' => 'You should never see this.', 'error_code' => 'you_should_never_see_this'), false);
}
$auth = $iwp_mmb_core->authenticate_message($action . $id, $signature, $id);
if ($auth === true) {
if ($action == 'maintain_site') {
iwp_mmb_maintain_site($params);
iwp_mmb_response(array('error' => 'You should never see this.', 'error_code' => 'you_should_never_see_this'), false);
}
@ignore_user_abort(true);
$GLOBALS['IWP_CLIENT_HISTORY_ID'] = $id;
if (isset($params['username']) && !is_user_logged_in()) {
$user = function_exists('get_user_by') ? get_user_by('login', $params['username']) : get_userdatabylogin($params['username']);
wp_set_current_user($user->ID);
//For WPE or Reload Data
//if(@getenv('IS_WPE') || $iwp_action == 'get_stats')
$SET_14_DAYS_VALIDITY = true;
wp_set_auth_cookie($user->ID, $SET_14_DAYS_VALIDITY);
}
if ($action == 'get_cookie') {
iwp_mmb_response(true, true);
}
/* in case database upgrade required, do database backup and perform upgrade ( wordpress wp_upgrade() function ) */
if (strlen(trim($wp_db_version)) && !defined('ACX_PLUGIN_DIR')) {
if (get_option('db_version') != $wp_db_version) {
/* in multisite network, please update database manualy */
if (empty($wpmu_version) || function_exists('is_multisite') && !is_multisite()) {
if (!function_exists('wp_upgrade')) {
include_once ABSPATH . 'wp-admin/includes/upgrade.php';
}
ob_clean();
@wp_upgrade();
@do_action('after_db_upgrade');
ob_end_clean();
}
}
}
if (isset($params['secure'])) {
if ($decrypted = $iwp_mmb_core->_secure_data($params['secure'])) {
$decrypted = maybe_unserialize($decrypted);
if (is_array($decrypted)) {
foreach ($decrypted as $key => $val) {
if (!is_numeric($key)) {
$params[$key] = $val;
}
}
unset($params['secure']);
} else {
$params['secure'] = $decrypted;
}
} elseif (isset($params['secure']['account_info'])) {
//.........这里部分代码省略.........
开发者ID:Trideon,项目名称:gigolo,代码行数:101,代码来源:init.php
示例9: mmb_parse_request
function mmb_parse_request()
{
global $mmb_core, $wp_db_version, $wpmu_version, $_wp_using_ext_object_cache, $_mwp_data, $_mwp_auth;
if (empty($_mwp_auth)) {
MMB_Stats::set_hit_count();
return;
}
ob_start();
$_wp_using_ext_object_cache = false;
@set_time_limit(600);
if ($_mwp_data['action'] === 'add_site') {
mmb_add_site($_mwp_data['params']);
mmb_response('You should never see this.', false);
}
/* in case database upgrade required, do database backup and perform upgrade ( wordpress wp_upgrade() function ) */
if (strlen(trim($wp_db_version)) && !defined('ACX_PLUGIN_DIR')) {
if (get_option('db_version') != $wp_db_version) {
/* in multisite network, please update database manualy */
if (empty($wpmu_version) || function_exists('is_multisite') && !is_multisite()) {
if (!function_exists('wp_upgrade')) {
include_once ABSPATH . 'wp-admin/includes/upgrade.php';
}
ob_clean();
@wp_upgrade();
@do_action('after_db_upgrade');
ob_end_clean();
}
}
}
if (isset($_mwp_data['params']['secure'])) {
if ($decrypted = $mmb_core->_secure_data($_mwp_data['params']['secure'])) {
$decrypted = maybe_unserialize($decrypted);
if (is_array($decrypted)) {
foreach ($decrypted as $key => $val) {
if (!is_numeric($key)) {
$_mwp_data['params'][$key] = $val;
}
}
unset($_mwp_data['params']['secure']);
} else {
$_mwp_data['params']['secure'] = $decrypted;
}
}
}
if (isset($_mwp_data['setting'])) {
$mmb_core->save_options($_mwp_data['setting']);
}
if (!$mmb_core->register_action_params($_mwp_data['action'], $_mwp_data['params'])) {
global $_mmb_plugin_actions;
$_mmb_plugin_actions[$_mwp_data['action']] = $_mwp_data['params'];
}
ob_end_clean();
}
开发者ID:jeanpage,项目名称:ca_learn,代码行数:53,代码来源:init.php
示例10: update_db
/**
* Update the WordPress database.
*
* [--network]
* : Update databases for all sites on a network
*
* @subcommand update-db
*/
function update_db($_, $assoc_args)
{
global $wpdb, $wp_db_version;
$network = Utils\get_flag_value($assoc_args, 'network');
if ($network && !is_multisite()) {
WP_CLI::error('This is not a multisite install.');
}
if ($network) {
$iterator_args = array('table' => $wpdb->blogs, 'where' => array('spam' => 0, 'deleted' => 0, 'archived' => 0));
$it = new \WP_CLI\Iterators\Table($iterator_args);
$success = $total = 0;
foreach ($it as $blog) {
$total++;
$url = $blog->domain . $blog->path;
$process = WP_CLI::launch_self('core update-db', array(), array(), false, true, array('url' => $url));
if (0 == $process->return_code) {
WP_CLI::log("Database upgraded successfully on {$url}");
$success++;
} else {
WP_CLI::warning("Database failed to upgrade on {$url}");
}
}
if ($total && $success == $total) {
update_site_option('wpmu_upgrade_site', $wp_db_version);
}
WP_CLI::success(sprintf('WordPress database upgraded on %d/%d sites.', $success, $total));
} else {
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
wp_upgrade();
WP_CLI::success('WordPress database upgraded successfully.');
}
}
开发者ID:62William,项目名称:web-cms_wordpress-wp-cli,代码行数:40,代码来源:core.php
示例11: mmb_parse_request
function mmb_parse_request()
{
if (!isset($HTTP_RAW_POST_DATA)) {
$HTTP_RAW_POST_DATA = file_get_contents('php://input');
}
ob_start();
global $current_user, $mmb_core, $new_actions, $wp_db_version, $wpmu_version, $_wp_using_ext_object_cache, $_mmb_options;
/*$data = array();
if(substr($HTTP_RAW_POST_DATA, 0, 15) == "mwp_a=managewp&"){
$HTTP_RAW_POST_DATA = str_replace("mwp_a=managewp&", "", $HTTP_RAW_POST_DATA);
parse_str($HTTP_RAW_POST_DATA, $data);
}*/
if (substr($HTTP_RAW_POST_DATA, 0, 7) == "action=") {
$HTTP_RAW_POST_DATA = str_replace("action=", "", $HTTP_RAW_POST_DATA);
}
$data = base64_decode($HTTP_RAW_POST_DATA);
if ($data) {
$data = mmb_parse_data(@unserialize($data));
$num = @extract($data);
//$signature = base64_decode($signature);
}
if (isset($action)) {
$_wp_using_ext_object_cache = false;
@set_time_limit(600);
if (!$mmb_core->check_if_user_exists($params['username'])) {
mmb_response('Username <b>' . $params['username'] . '</b> does not have administrator capabilities. Enter the correct username in the site options.', false);
}
if ($action == 'add_site') {
mmb_add_site($params);
mmb_response('You should never see this.', false);
}
$auth = $mmb_core->authenticate_message($action . $id, $signature, $id);
if ($auth === true) {
if (isset($params['username']) && !is_user_logged_in()) {
$user = function_exists('get_user_by') ? get_user_by('login', $params['username']) : get_userdatabylogin($params['username']);
wp_set_current_user($user->ID);
}
/* in case database upgrade required, do database backup and perform upgrade ( wordpress wp_upgrade() function ) */
if (strlen(trim($wp_db_version)) && !defined('ACX_PLUGIN_DIR')) {
if (get_option('db_version') != $wp_db_version) {
/* in multisite network, please update database manualy */
if (empty($wpmu_version) || function_exists('is_multisite') && !is_multisite()) {
if (!function_exists('wp_upgrade')) {
include_once ABSPATH . 'wp-admin/includes/upgrade.php';
}
ob_clean();
@wp_upgrade();
@do_action('after_db_upgrade');
ob_end_clean();
}
}
}
if (isset($params['secure'])) {
if ($decrypted = $mmb_core->_secure_data($params['secure'])) {
$decrypted = maybe_unserialize($decrypted);
if (is_array($decrypted)) {
foreach ($decrypted as $key => $val) {
if (!is_numeric($key)) {
$params[$key] = $val;
}
}
unset($params['secure']);
} else {
$params['secure'] = $decrypted;
}
}
}
if (isset($data['setting'])) {
$mmb_core->save_options($data['setting']);
}
if (!$mmb_core->register_action_params($action, $params)) {
global $_mmb_plugin_actions;
$_mmb_plugin_actions[$action] = $params;
}
} else {
mmb_response($auth['error'], false);
}
} else {
MMB_Stats::set_hit_count();
}
ob_end_clean();
}
开发者ID:juslee,项目名称:e27,代码行数:82,代码来源:init.php
示例12: _wprp_upgrade_core
function _wprp_upgrade_core()
{
if (defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS) {
return new WP_Error('disallow-file-mods', __("File modification is disabled with the DISALLOW_FILE_MODS constant.", 'wpremote'));
}
include_once ABSPATH . 'wp-admin/includes/admin.php';
include_once ABSPATH . 'wp-admin/includes/upgrade.php';
include_once ABSPATH . 'wp-includes/update.php';
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
require_once WPRP_PLUGIN_PATH . 'inc/class-wprp-core-upgrader-skin.php';
// check for filesystem access
if (!_wpr_check_filesystem_access()) {
return new WP_Error('filesystem-not-writable', __('The filesystem is not writable with the supplied credentials', 'wpremote'));
}
// force refresh
wp_version_check();
$updates = get_core_updates();
if (is_wp_error($updates) || !$updates) {
return new WP_Error('no-update-available');
}
$update = reset($updates);
if (!$update) {
return new WP_Error('no-update-available');
}
$skin = new WPRP_Core_Upgrader_Skin();
$upgrader = new Core_Upgrader($skin);
$result = $upgrader->upgrade($update);
if (is_wp_error($result)) {
return $result;
}
global $wp_current_db_version, $wp_db_version;
// we have to include version.php so $wp_db_version
// will take the version of the updated version of wordpress
require ABSPATH . WPINC . '/version.php';
wp_upgrade();
return true;
}
开发者ID:phpwomen,项目名称:combell,代码行数:37,代码来源:plugin.php
示例13: wp_oracle_get_core_upgrade
public function wp_oracle_get_core_upgrade()
{
include_once ABSPATH . 'wp-admin/includes/admin.php';
include_once ABSPATH . 'wp-admin/includes/upgrade.php';
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
require_once ABSPATH . 'wp-admin/includes/update.php';
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-wordpress-oracle-core-upgrader-skin.php';
// force refresh
wp_version_check();
$updates = get_core_updates();
$update = reset($updates);
$skin = new Wordpress_Oracle_Core_Upgrader_Skin();
$upgrader = new Core_Upgrader($skin);
$result = $upgrader->upgrade($update, array('allow_relaxed_file_ownership' => true));
if (is_wp_error($result)) {
return $result;
}
global $wp_current_db_version, $wp_db_version;
// we have to include version.php so $wp_db_version
// will take the version of the updated version of wordpress
require ABSPATH . WPINC . '/version.php';
wp_upgrade();
return array('blog' => array('core_version' => $result));
}
开发者ID:raqqun,项目名称:wordpress-oracle,代码行数:24,代码来源:class-wordpress-oracle-api-controllers.php
注:本文中的wp_upgrade函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论