本文整理汇总了PHP中wp_check_mysql_version函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_check_mysql_version函数的具体用法?PHP wp_check_mysql_version怎么用?PHP wp_check_mysql_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_check_mysql_version函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wp_install
function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '')
{
global $wpdb;
$base = '/';
$domain = JQUERY_STAGING_PREFIX . 'jquery.com';
wp_check_mysql_version();
wp_cache_flush();
make_db_current_silent();
populate_options();
populate_roles();
$user_id = wp_create_user($user_name, trim($user_password), $user_email);
$user = new WP_User($user_id);
$user->set_role('administrator');
$guess_url = wp_guess_url();
foreach ($wpdb->tables('ms_global') as $table => $prefixed_table) {
$wpdb->{$table} = $prefixed_table;
}
install_network();
populate_network(1, $domain, $user_email, 'jQuery Network', $base, false);
update_site_option('site_admins', array($user->user_login));
update_site_option('allowedthemes', array());
$wpdb->insert($wpdb->blogs, array('site_id' => 1, 'domain' => $domain, 'path' => $base, 'registered' => current_time('mysql')));
$blog_id = $wpdb->insert_id;
update_user_meta($user_id, 'source_domain', $domain);
update_user_meta($user_id, 'primary_blog', $blog_id);
if (!($upload_path = get_option('upload_path'))) {
$upload_path = substr(WP_CONTENT_DIR, strlen(ABSPATH)) . '/uploads';
update_option('upload_path', $upload_path);
}
update_option('fileupload_url', get_option('siteurl') . '/' . $upload_path);
jquery_install_remaining_sites($user);
wp_new_blog_notification($blog_title, $guess_url, $user_id, $message = __('The password you chose during the install.'));
wp_cache_flush();
return array('url' => $guess_url, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
}
开发者ID:ravasthi,项目名称:web-base-template,代码行数:35,代码来源:install.php
示例2: wp_install
/**
* Installs the site.
*
* Runs the required functions to set up and populate the database,
* including primary admin user and initial options.
*
* @since 2.1.0
*
* @param string $blog_title Blog title.
* @param string $user_name User's username.
* @param string $user_email User's email.
* @param bool $public Whether blog is public.
* @param string $deprecated Optional. Not used.
* @param string $user_password Optional. User's chosen password. Default empty (random password).
* @param string $language Optional. Language chosen. Default empty.
* @return array Array keys 'url', 'user_id', 'password', and 'password_message'.
*/
function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '', $language = '')
{
if (!empty($deprecated)) {
_deprecated_argument(__FUNCTION__, '2.6');
}
wp_check_mysql_version();
wp_cache_flush();
make_db_current_silent();
populate_options();
populate_roles();
update_option('blogname', $blog_title);
update_option('admin_email', $user_email);
update_option('blog_public', $public);
if ($language) {
update_option('WPLANG', $language);
}
$guessurl = wp_guess_url();
update_option('siteurl', $guessurl);
// If not a public blog, don't ping.
if (!$public) {
update_option('default_pingback_flag', 0);
}
/*
* Create default user. If the user already exists, the user tables are
* being shared among blogs. Just set the role in that case.
*/
$user_id = username_exists($user_name);
$user_password = trim($user_password);
$email_password = false;
if (!$user_id && empty($user_password)) {
$user_password = wp_generate_password(12, false);
$message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
$user_id = wp_create_user($user_name, $user_password, $user_email);
update_user_option($user_id, 'default_password_nag', true, true);
$email_password = true;
} elseif (!$user_id) {
// Password has been provided
$message = '<em>' . __('Your chosen password.') . '</em>';
$user_id = wp_create_user($user_name, $user_password, $user_email);
} else {
$message = __('User already exists. Password inherited.');
}
$user = new WP_User($user_id);
$user->set_role('administrator');
wp_install_defaults($user_id);
wp_install_maybe_enable_pretty_permalinks();
flush_rewrite_rules();
wp_new_blog_notification($blog_title, $guessurl, $user_id, $email_password ? $user_password : __('The password you chose during the install.'));
wp_cache_flush();
/**
* Fires after a site is fully installed.
*
* @since 3.9.0
*
* @param WP_User $user The site owner.
*/
do_action('wp_install', $user);
return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
}
开发者ID:leonardopires,项目名称:projectnami,代码行数:76,代码来源:upgrade.php
示例3: wp_install
/**
* This function overrides wp_install() in wp-admin/includes/upgrade.php
*/
function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '')
{
if (!empty($deprecated)) {
_deprecated_argument(__FUNCTION__, '2.6');
}
wp_check_mysql_version();
wp_cache_flush();
/* changes */
require_once PDODIR . 'schema.php';
make_db_sqlite();
/* changes */
populate_options();
populate_roles();
update_option('blogname', $blog_title);
update_option('admin_email', $user_email);
update_option('blog_public', $public);
$guessurl = wp_guess_url();
update_option('siteurl', $guessurl);
if (!$public) {
update_option('default_pingback_flag', 0);
}
$user_id = username_exists($user_name);
$user_password = trim($user_password);
$email_password = false;
if (!$user_id && empty($user_password)) {
$user_password = wp_generate_password(12, false);
$message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
$user_id = wp_create_user($user_name, $user_password, $user_email);
update_user_option($user_id, 'default_password_nag', true, true);
$email_password = true;
} else {
if (!$user_id) {
$message = '<em>' . __('Your chosen password.') . '</em>';
$user_id = wp_create_user($user_name, $user_password, $user_email);
}
}
$user = new WP_User($user_id);
$user->set_role('administrator');
wp_install_defaults($user_id);
flush_rewrite_rules();
wp_new_blog_notification($blog_title, $guessurl, $user_id, $email_password ? $user_password : __('The password you chose during the install.'));
wp_cache_flush();
if (isset($_SERVER['SERVER_SOFTWARE']) && stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false || isset($_SERVER['SERVER_SIGNATURE']) && stripos($_SERVER['SERVER_SIGNATURE'], 'apache') !== false) {
// Your server is Apache. Nothing to do more.
} else {
$server_message = sprintf('Your webserver doesn\'t seem to be Apache. So the database directory access restriction by the .htaccess file may not function. We strongly recommend that you should restrict the access to the directory %s in some other way.', FQDBDIR);
echo '<div style="position: absolute; margin-top: 350px; width: 700px; border: .5px dashed rgb(0, 0, 0);"><p style="margin: 10px;">';
echo $server_message;
echo '</p></div>';
}
return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
}
开发者ID:pthiep,项目名称:pthiepwordpress,代码行数:55,代码来源:install.php
示例4: wp_install
/**
* This function overrides wp_install() in wp-admin/includes/upgrade.php
*/
function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '')
{
if (!empty($deprecated)) {
_deprecated_argument(__FUNCTION__, '2.6');
}
wp_check_mysql_version();
wp_cache_flush();
/* changes */
require_once PDODIR . 'schema.php';
make_db_sqlite();
/* changes */
populate_options();
populate_roles();
update_option('blogname', $blog_title);
update_option('admin_email', $user_email);
update_option('blog_public', $public);
$guessurl = wp_guess_url();
update_option('siteurl', $guessurl);
if (!$public) {
update_option('default_pingback_flag', 0);
}
$user_id = username_exists($user_name);
$user_password = trim($user_password);
$email_password = false;
if (!$user_id && empty($user_password)) {
$user_password = wp_generate_password(12, false);
$message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
$user_id = wp_create_user($user_name, $user_password, $user_email);
update_user_option($user_id, 'default_password_nag', true, true);
$email_password = true;
} else {
if (!$user_id) {
$message = '<em>' . __('Your chosen password.') . '</em>';
$user_id = wp_create_user($user_name, $user_password, $user_email);
}
}
$user = new WP_User($user_id);
$user->set_role('administrator');
wp_install_defaults($user_id);
flush_rewrite_rules();
wp_new_blog_notification($blog_title, $guessurl, $user_id, $email_password ? $user_password : __('The password you chose during the install.'));
wp_cache_flush();
if (isset($_SERVER['SERVER_SOFTWARE']) && stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false || isset($_SERVER['SERVER_SIGNATURE']) && stripos($_SERVER['SERVER_SIGNATURE'], 'apache') !== false) {
// Your server is Apache. Nothing to do more.
}
return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
}
开发者ID:daniel-marklund,项目名称:sqlite-plugin-wordpress,代码行数:50,代码来源:install.php
示例5: 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
示例6: 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();
}
开发者ID:ericandrewlewis,项目名称:wordpress-mu,代码行数:27,代码来源:upgrade.php
示例7: 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();
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:15,代码来源:upgrade.php
示例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
*/
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());" );
}
/**
* 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:ShankarVellal,项目名称:WordPress,代码行数:49,代码来源:upgrade.php
示例9: 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);
}
开发者ID:7press,项目名称:7press,代码行数:38,代码来源:upgrade.php
注:本文中的wp_check_mysql_version函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论