本文整理汇总了PHP中backupbuddy_core::alert_core_file_excludes方法的典型用法代码示例。如果您正苦于以下问题:PHP backupbuddy_core::alert_core_file_excludes方法的具体用法?PHP backupbuddy_core::alert_core_file_excludes怎么用?PHP backupbuddy_core::alert_core_file_excludes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backupbuddy_core
的用法示例。
在下文中一共展示了backupbuddy_core::alert_core_file_excludes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pre_backup
//.........这里部分代码省略.........
pb_backupbuddy::status('details', 'Active WordPress plugins: `' . implode('; ', $activePlugins) . '`.');
pb_backupbuddy::status('startSubFunction', json_encode(array('function' => 'wp_plugins_found', 'title' => 'Found ' . count($activePlugins) . ' active WordPress plugins.')));
unset($activePlugins);
// Compression to bool.
/*
if ( $profile['compression'] == '1' ) {
$profile['compression'] = true;
} else {
$profile['compression'] = false;
}
*/
if (pb_backupbuddy::$options['compression'] == '1') {
$compression = true;
} else {
$compression = false;
}
$archiveURL = '';
$abspath = str_replace('\\', '/', ABSPATH);
// Change slashes to handle Windows as we store backup_directory with Linux-style slashes even on Windows.
$backup_dir = str_replace('\\', '/', backupbuddy_core::getBackupDirectory());
if (FALSE !== stristr($backup_dir, $abspath)) {
// Make sure file to download is in a publicly accessible location (beneath WP web root technically).
$sitepath = str_replace($abspath, '', $backup_dir);
$archiveURL = rtrim(site_url(), '/\\') . '/' . trim($sitepath, '/\\') . '/' . basename($archiveFile);
}
$forceSingleDatabaseFile = false;
if ('1' == pb_backupbuddy::$options['force_single_db_file']) {
$forceSingleDatabaseFile = true;
}
// Set up the backup data.
$this->_backup = array('data_version' => 1, 'backupbuddy_version' => pb_backupbuddy::settings('version'), 'serial' => $serial, 'init_complete' => false, 'backup_mode' => $profile['backup_mode'], 'type' => $type, 'profile' => $profile, 'default_profile' => pb_backupbuddy::$options['profiles'][0], 'start_time' => time(), 'finish_time' => 0, 'updated_time' => time(), 'status' => array(), 'max_execution_time' => backupbuddy_core::adjustedMaxExecutionTime(), 'archive_size' => 0, 'schedule_title' => $schedule_title, 'backup_directory' => backupbuddy_core::getBackupDirectory(), 'archive_file' => $archiveFile, 'archive_url' => $archiveURL, 'trigger' => $trigger, 'zip_method_strategy' => pb_backupbuddy::$options['zip_method_strategy'], 'compression' => $compression, 'ignore_zip_warnings' => pb_backupbuddy::$options['ignore_zip_warnings'], 'ignore_zip_symlinks' => pb_backupbuddy::$options['ignore_zip_symlinks'], 'steps' => array(), 'integrity' => array(), 'temp_directory' => '', 'backup_root' => '', 'export_plugins' => array(), 'additional_table_includes' => array(), 'additional_table_excludes' => array(), 'directory_exclusions' => backupbuddy_core::get_directory_exclusions($profile, false, $serial), 'table_sizes' => array(), 'breakout_tables' => array(), 'force_single_db_file' => $forceSingleDatabaseFile, 'deployment_log' => '', 'deployment_direction' => $deployDirection, 'deployment_destination' => $deployDestinationSettings, 'runnerUID' => get_current_user_id());
pb_backupbuddy::status('startSubFunction', json_encode(array('function' => 'file_excludes', 'title' => 'Found ' . count($this->_backup['directory_exclusions']) . ' file or directory exclusions.')));
// Warn if excluding key paths.
$alertFileExcludes = backupbuddy_core::alert_core_file_excludes($this->_backup['directory_exclusions']);
foreach ($alertFileExcludes as $alertFileExcludeId => $alertFileExclude) {
pb_backupbuddy::status('warning', $alertFileExclude);
}
pb_backupbuddy::anti_directory_browsing(backupbuddy_core::getTempDirectory(), $die = false);
// Figure out paths.
if ($this->_backup['type'] == 'full' || $this->_backup['type'] == 'files') {
$this->_backup['temp_directory'] = backupbuddy_core::getTempDirectory() . $serial . '/';
$this->_backup['backup_root'] = ABSPATH;
// ABSPATH contains trailing slash.
} elseif ($this->_backup['type'] == 'db') {
$this->_backup['temp_directory'] = backupbuddy_core::getTempDirectory() . $serial . '/';
$this->_backup['backup_root'] = $this->_backup['temp_directory'];
} elseif ($this->_backup['type'] == 'export') {
// WordPress unzips into wordpress subdirectory by default so must include that in path.
$this->_backup['temp_directory'] = backupbuddy_core::getTempDirectory() . $serial . '/wordpress/wp-content/uploads/backupbuddy_temp/' . $serial . '/';
// We store temp data for export within the temporary WordPress installation within the temp directory. A bit confusing; sorry about that.
$this->_backup['backup_root'] = backupbuddy_core::getTempDirectory() . $serial . '/wordpress/';
} else {
pb_backupbuddy::status('error', __('Backup FAILED. Unknown backup type.', 'it-l10n-backupbuddy'));
pb_backupbuddy::status('haltScript', '');
// Halt JS on page.
}
pb_backupbuddy::status('details', 'Temp directory: `' . $this->_backup['temp_directory'] . '`.');
pb_backupbuddy::status('details', 'Backup root: `' . $this->_backup['backup_root'] . '`.');
// Plugins to export (only for MS exports).
if (count($export_plugins) > 0) {
$this->_backup['export_plugins'] = $export_plugins;
}
// Calculate additional database table inclusion/exclusion.
$additional_includes = explode("\n", $profile['mysqldump_additional_includes']);
array_walk($additional_includes, create_function('&$val', '$val = trim($val);'));
$this->_backup['additional_table_includes'] = array_unique($additional_includes);
示例2: trim
// If global tables then set table includes & excludes to -1.
$field = 'pb_backupbuddy_profiles#' . $profile . '#profile_globaltables';
if (isset($_POST[$field]) && $_POST[$field] == '1') {
$_POST['pb_backupbuddy_profiles#' . $profile . '#mysqldump_additional_includes'] = '-1';
$_POST['pb_backupbuddy_profiles#' . $profile . '#mysqldump_additional_excludes'] = '-1';
}
// If global excludes then set excludes to -1.
$field = 'pb_backupbuddy_profiles#' . $profile . '#profile_globalexcludes';
if (isset($_POST[$field]) && $_POST[$field] == '1') {
$_POST['pb_backupbuddy_profiles#' . $profile . '#excludes'] = '-1';
}
$process_result = $settings_form->process();
// Handles processing the submitted form (if applicable).
if (count((array) $process_result['errors']) == 0 && count((array) $process_result['data']) > 0) {
$excludes = pb_backupbuddy::_POST('pb_backupbuddy_profiles#' . $profile . '#mysqldump_additional_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);
}
if (count($fileExcludes) == 0) {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
var win = window.dialogArguments || opener || parent || top;
win.pb_backupbuddy_profile_updated( '<?php
echo $profile;
?>
', '<?php
echo htmlentities(pb_backupbuddy::$options['profiles'][$profile]['title']);
?>
' );