本文整理汇总了PHP中wp_set_wpdb_vars函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_set_wpdb_vars函数的具体用法?PHP wp_set_wpdb_vars怎么用?PHP wp_set_wpdb_vars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_set_wpdb_vars函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sixscan_installation_manager
function sixscan_installation_manager()
{
/* If running from partner install, the logic is a bit different */
if (sixscan_common_is_partner_version() && sixscan_installation_partner_is_to_install() === FALSE) {
return;
}
/* Before install of any kind progresses, user is shown a registration page.
On the first load it shows a registration screen and returns False.
If user clicks 'Agree' - the page reloads with &agree=yes parameter, sixscan_registration_at_install() returns True and registration continues.
No data is transferred to the server until user clicks "Agree" */
if (sixscan_registration_at_install() === FALSE) {
return;
}
/* If we are waiting for user to input wpfs data */
$tmp_key = sixscan_common_generate_random_string();
if (sixscan_installation_wpfs_init($tmp_key) == FALSE) {
return;
}
/* Run the install */
$install_result = sixscan_installation_install($tmp_key);
if ($install_result !== TRUE) {
/* If the install failed - print error message and deactivate the plugin */
if (sixscan_common_is_partner_version() === FALSE) {
print $install_result;
/* Makes 6Scan not-active */
$sixscan_plugin_name = plugin_basename(realpath(dirname(__FILE__) . "/../../6scan.php"));
/* This dirty patch is required because some hostings (free?) have a short sql timeout. When it timeouts, 6Scan can't
disable itelf, and user gets stuck in infinite deactivate loop.
We can't enlarge the timeout, since it requires sql root access. We can only reconnect to the SQL.
This hack reconnects to SQL and deactivates the plugin */
if (mysql_errno() != 0) {
global $wpdb;
$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
wp_set_wpdb_vars();
}
/* deactivate myself */
deactivate_plugins($sixscan_plugin_name);
} else {
if (sixscan_installation_partner_run_first_time() === FALSE) {
/* If we are in partner version, but not running for the first time - we can show the error */
print $install_result;
}
}
} else {
/* No redirects in partner version */
if (sixscan_common_is_partner_version() === FALSE) {
sixscan_registration_forward_to_dashboard("&sixscan_activated=1");
}
}
/* Zeroize our databse flag, so that we only try installing one time */
if (sixscan_common_is_partner_version()) {
sixscan_installation_partner_mark_install_tried();
}
/* Since registration is now on the client side, we no longer have to wait for server activation */
sixscan_common_set_account_operational(TRUE);
}
开发者ID:nhathong1204,项目名称:bdshungthinh,代码行数:56,代码来源:installation.php
示例2: wp_set_lang_dir
WP_DEBUG ? include WP_CONTENT_DIR . '/advanced-cache.php' : @(include WP_CONTENT_DIR . '/advanced-cache.php');
}
// Define WP_LANG_DIR if not set.
wp_set_lang_dir();
// Load early WordPress files.
require ABSPATH . WPINC . '/compat.php';
require ABSPATH . WPINC . '/functions.php';
require ABSPATH . WPINC . '/class-wp.php';
require ABSPATH . WPINC . '/class-wp-error.php';
require ABSPATH . WPINC . '/plugin.php';
require ABSPATH . WPINC . '/pomo/mo.php';
// Include the wpdb class and, if present, a db.php database drop-in.
require_wp_db();
// Set the database table prefix and the format specifiers for database table columns.
$GLOBALS['table_prefix'] = $table_prefix;
wp_set_wpdb_vars();
// Start the WordPress object cache, or an external object cache if the drop-in is present.
wp_start_object_cache();
// Attach the default filters.
require ABSPATH . WPINC . '/default-filters.php';
// Initialize multisite if enabled.
if (is_multisite()) {
require ABSPATH . WPINC . '/ms-blogs.php';
require ABSPATH . WPINC . '/ms-settings.php';
} elseif (!defined('MULTISITE')) {
define('MULTISITE', false);
}
register_shutdown_function('shutdown_action_hook');
// Stop most of WordPress from being loaded if we just want the basics.
if (SHORTINIT) {
return false;
开发者ID:openify,项目名称:wordpress-composer,代码行数:31,代码来源:wp-settings.php
示例3: wpdb_reconnect
function wpdb_reconnect()
{
global $wpdb;
$old_wpdb = $wpdb;
//Reconnect to avoid timeout problem after ZIP files
if (class_exists('wpdb') && function_exists('wp_set_wpdb_vars')) {
if ($wpdb->use_mysqli) {
@mysqli_close($wpdb->dbh);
} else {
if (function_exists('mysql_close')) {
@mysql_close($wpdb->dbh);
}
}
$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
wp_set_wpdb_vars();
$wpdb->options = $old_wpdb->options;
//fix for multi site full backup
}
}
开发者ID:Trideon,项目名称:gigolo,代码行数:19,代码来源:backup.class.multicall.php
示例4: wpdb_reconnect
/**
* Reconnects to database to avoid timeout problem after ZIP files.
*
* @return void
*/
public function wpdb_reconnect()
{
/** @var wpdb $wpdb */
global $wpdb;
if (is_callable(array($wpdb, 'check_connection'))) {
$wpdb->check_connection();
return;
}
if (class_exists('wpdb') && function_exists('wp_set_wpdb_vars')) {
@mysql_close($wpdb->dbh);
/** @handled class */
$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
wp_set_wpdb_vars();
if (function_exists('is_multisite')) {
if (is_multisite()) {
$wpdb->set_blog_id(get_current_blog_id());
}
}
}
}
开发者ID:jimrucinski,项目名称:Vine,代码行数:25,代码来源:Backup.php
示例5: wpdb_reconnect
/**
* Reconnects to database to avoid timeout problem after ZIP files.
*
* @return void
*/
function wpdb_reconnect()
{
global $wpdb;
if (class_exists('wpdb') && function_exists('wp_set_wpdb_vars')) {
@mysql_close($wpdb->dbh);
$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
wp_set_wpdb_vars();
}
}
开发者ID:jeanpage,项目名称:ca_learn,代码行数:14,代码来源:backup.class.php
注:本文中的wp_set_wpdb_vars函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论