本文整理匯總了PHP中backupbuddy_core::alert_core_table_excludes方法的典型用法代碼示例。如果您正苦於以下問題:PHP backupbuddy_core::alert_core_table_excludes方法的具體用法?PHP backupbuddy_core::alert_core_table_excludes怎麽用?PHP backupbuddy_core::alert_core_table_excludes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類backupbuddy_core
的用法示例。
在下文中一共展示了backupbuddy_core::alert_core_table_excludes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pre_backup
//.........這裏部分代碼省略.........
$this->_backup['steps'][] = array('function' => 'ms_create_wp_config', 'args' => array(), 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0);
$this->_backup['steps'][] = array('function' => 'ms_copy_plugins', 'args' => array(), 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0);
$this->_backup['steps'][] = array('function' => 'ms_copy_themes', 'args' => array(), 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0);
$this->_backup['steps'][] = array('function' => 'ms_copy_media', 'args' => array(), 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0);
$this->_backup['steps'][] = array('function' => 'ms_copy_users_table', 'args' => array(), 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0);
}
if ('pull' != $deployDirection && '1' != $profile['skip_database_dump'] && $profile['type'] != 'files') {
// Backup database if not skipping AND not a files only backup.
global $wpdb;
// Default tables to backup.
if ($type == 'export') {
// Multisite Subsite export only dumps tables specific to this subsite prefix.
$base_dump_mode = 'prefix';
} else {
// Non-multisite export so use profile to determine tables to backup.
if ($profile['backup_nonwp_tables'] == '1') {
// Backup all tables.
$base_dump_mode = 'all';
} elseif ($profile['backup_nonwp_tables'] == '2') {
// Backup no tables by default. Relies on listed additional tables.
$base_dump_mode = 'none';
} else {
// Only backup matching prefix.
$base_dump_mode = 'prefix';
}
}
$additional_tables = $this->_backup['additional_table_includes'];
if ($type == 'export') {
global $wpdb;
array_push($additional_tables, $wpdb->prefix . "users");
array_push($additional_tables, $wpdb->prefix . "usermeta");
}
// Warn if excluding key WP tables.
$tableExcludes = backupbuddy_core::alert_core_table_excludes($this->_backup['additional_table_excludes']);
foreach ($tableExcludes as $tableExcludeId => $tableExclude) {
pb_backupbuddy::status('warning', $tableExclude);
}
// Calculate tables to dump based on the provided information. $tables will be an array of tables.
$tables = $this->_calculate_tables($base_dump_mode, $additional_tables, $this->_backup['additional_table_excludes']);
pb_backupbuddy::status('startSubFunction', json_encode(array('function' => 'calculate_tables', 'title' => 'Found ' . count($tables) . ' tables to backup based on settings.', 'more' => 'Tables: ' . implode(', ', $tables))));
// If calculations show NO database tables should be backed up then change mode to skip database dump.
if (0 == count($tables)) {
pb_backupbuddy::status('warning', 'WARNING #857272: No database tables will be backed up based on current settings. This will not be a complete backup. Adjust settings if this is not intended and use with caution. Skipping database dump step.');
$profile['skip_database_dump'] = '1';
$this->_backup['profile']['skip_database_dump'] = '1';
} else {
// One or more tables set to backup.
// Obtain tables sizes. Surround each table name by a single quote and implode with commas for SQL query to get sizes.
$tables_formatted = $tables;
foreach ($tables_formatted as &$table_formatted) {
$table_formatted = "'{$table_formatted}'";
}
$tables_formatted = implode(',', $tables_formatted);
$sql = "SHOW TABLE STATUS WHERE Name IN({$tables_formatted});";
$rows = $wpdb->get_results($sql, ARRAY_A);
if (false === $rows) {
pb_backupbuddy::alert('Error #85473474: Unable to retrieve table status. Query: `' . $sql . '`.', true);
return false;
}
$totalDatabaseSize = 0;
foreach ($rows as $row) {
$this->_backup['table_sizes'][$row['Name']] = $row['Data_length'] + $row['Index_length'];
$totalDatabaseSize += $this->_backup['table_sizes'][$row['Name']];
}
unset($rows);
unset($tables_formatted);
示例2: __
$settings_form->add_setting(array('type' => 'text', 'name' => 'archive_limit_age', 'title' => __('Age limit of local backups', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 90] - Maximum age (in days) to allow your local archives to reach (remote archive limits are configured per destination on their respective settings pages). Any backups exceeding this age will be deleted as new backups are created. Changes to this setting take place once a new backup is made. Set to zero (0) for no limit.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[0-99999]|int', 'css' => 'width: 50px;', 'after' => ' days. <span class="description">0 for no limit.</span>'));
if (is_multisite()) {
$settings_form->add_setting(array('type' => 'title', 'name' => 'title_multisite', 'title' => __('Multisite', 'it-l10n-backupbuddy')));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'multisite_export', 'title' => __('Allow individual site exports by administrators?', 'it-l10n-backupbuddy') . ' ' . pb_backupbuddy::video('_oKGIzzuVzw', __('Multisite export', 'it-l10n-backupbuddy'), false), 'options' => array('unchecked' => '0', 'checked' => '1'), 'tip' => __('[Default: disabled] - When enabled individual sites may be exported by Administrators of the individual site. Network Administrators always see this menu (notes with the words SuperAdmin in parentheses in the menu when only SuperAdmins have access to the feature).', 'it-l10n-backupbuddy'), 'rules' => 'required', 'after' => '<span class="description"> ' . __('Check to extend Site Exporting functionality to subsite Administrators.', 'it-l10n-backupbuddy') . '</span>'));
}
$profile = 0;
// Defaults index.
$settings_form->add_setting(array('type' => 'title', 'name' => 'title_database', 'title' => __('Database Defaults', 'it-l10n-backupbuddy')));
require_once pb_backupbuddy::plugin_path() . '/views/settings/_database.php';
$settings_form->add_setting(array('type' => 'title', 'name' => 'title_files', 'title' => __('File & Directory Defaults', 'it-l10n-backupbuddy')));
require_once pb_backupbuddy::plugin_path() . '/views/settings/_files.php';
$process_result = $settings_form->process();
// Handles processing the submitted form (if applicable).
if (count((array) $process_result['errors']) == 0) {
$table_excludes = pb_backupbuddy::_POST('pb_backupbuddy_profiles#0#mysqldump_additional_excludes');
$tableExcludes = backupbuddy_core::alert_core_table_excludes(explode("\n", trim($table_excludes)));
foreach ($tableExcludes as $tableExcludeId => $tableExclude) {
pb_backupbuddy::disalert($tableExcludeId, '<span class="pb_label pb_label-important">Warning</span> ' . $tableExclude);
}
$excludes = pb_backupbuddy::_POST('pb_backupbuddy_profiles#0#excludes');
$fileExcludes = backupbuddy_core::alert_core_file_excludes(explode("\n", trim($excludes)));
foreach ($fileExcludes as $fileExcludeId => $fileExclude) {
pb_backupbuddy::disalert($fileExcludeId, '<span class="pb_label pb_label-important">Warning</span> ' . $fileExclude);
}
}
$settings_form->set_value('importbuddy_pass_hash', $importbuddy_pass_dummy_text);
/* END CONFIGURING PLUGIN SETTINGS FORM */
$settings_form->display_settings('Save General Settings');
?>