当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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);
开发者ID:jcwproductions,项目名称:jcwproductions-blog,代码行数:67,代码来源:backup.php

示例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');
?>

开发者ID:arobbins,项目名称:iab,代码行数:29,代码来源:_general.php


注:本文中的backupbuddy_core::alert_core_table_excludes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。