本文整理汇总了PHP中pb_backupbuddy_settings::set_value方法的典型用法代码示例。如果您正苦于以下问题:PHP pb_backupbuddy_settings::set_value方法的具体用法?PHP pb_backupbuddy_settings::set_value怎么用?PHP pb_backupbuddy_settings::set_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_backupbuddy_settings
的用法示例。
在下文中一共展示了pb_backupbuddy_settings::set_value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'delete_archives_pre_backup', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Delete all backup archives prior to backups', 'it-l10n-backupbuddy'), 'tip' => __('[Default: disabled] - When enabled all local backup archives will be deleted prior to each backup. This is useful if in compatibilty mode to prevent backing up existing files.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Check if using compatibilty mode & exclusions are unavailable.', 'it-l10n-backupbuddy') . '</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'compression', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Enable zip compression', 'it-l10n-backupbuddy'), 'tip' => __('[Default: enabled] - ZIP compression decreases file sizes of stored backups. If you are encountering timeouts due to the script running too long, disabling compression may allow the process to complete faster.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Uncheck for large sites causing backups to not complete.', 'it-l10n-backupbuddy') . '</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'integrity_check', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Perform integrity check on backup files', 'it-l10n-backupbuddy'), 'tip' => __('[Default: enabled] - By default each backup file is checked for integrity and completion the first time it is viewed on the Backup page. On some server configurations this may cause memory problems as the integrity checking process is intensive. If you are experiencing out of memory errors on the Backup file listing, you can uncheck this to disable this feature.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Uncheck if having problems viewing your backup listing.', 'it-l10n-backupbuddy') . '</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'force_compatibility', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Force compatibility mode zip', 'it-l10n-backupbuddy'), 'tip' => __('[Default: disabled] - (WARNING: This forces the potentially slower mode of zip creation. Only use if absolutely necessary. Checking this box can cause backup failures if it is not needed.) Under normal circumstances compatibility mode is automatically entered as needed without user intervention. However under some server configurations the native backup system is unavailable but is incorrectly reported as functioning by the server. Forcing compatibility may fix problems in this situation by bypassing the native backup system check entirely.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Check if absolutely necessary or directed by support.', 'it-l10n-backupbuddy') . '</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'force_mysqldump_compatibility', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Force compatibility mode database dump', 'it-l10n-backupbuddy'), 'tip' => __('[Default: disabled] - WARNING: This forces the potentially slower mode of database dumping. Under normal circumstances mysql dump compatibility mode is automatically entered as needed without user intervention.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Check if database dumping fails. Pre-v3.x mode.', 'it-l10n-backupbuddy') . '</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'skip_database_dump', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Skip database dump on backup', 'it-l10n-backupbuddy'), 'tip' => __('[Default: disabled] - (WARNING: This prevents BackupBuddy from backing up the database during any kind of backup. This is for troubleshooting / advanced usage only to work around being unable to backup the database.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Check if unable to backup database for some reason.', 'it-l10n-backupbuddy') . '</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'include_importbuddy', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Include ImportBuddy in full backup archive', 'it-l10n-backupbuddy'), 'tip' => __('[Default: enabled] - When enabled, the importbuddy.php file will be included within the backup archive ZIP file. This file can be used to restore your site. Inclusion in the ZIP file itself insures you always have access to it. importbuddy.php is only included in full backups and only when this option is enabled.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Uncheck to skip adding ImportBuddy to backup archive.', 'it-l10n-backupbuddy') . '</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'alternative_zip', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Alternative zip system (BETA)', 'it-l10n-backupbuddy'), 'tip' => __('[Default: Disabled] Use if directed by support. Allows use of directory exclusion when in PCLZip Compatibility Mode.', 'it-l10n-backupbuddy') . '</span>', 'css' => '', 'after' => '<span class="description"> Check if stuck in compatibiilty (PCLZip) mode for directory exclusions,<br> having trouble during ZIP creation, or directed by support.</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'disable_zipmethod_caching', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Disable zip method caching', 'it-l10n-backupbuddy'), 'tip' => __('[Default: Disabled] Use if directed by support. Bypasses caching available zip methods so they are always displayed in logs. When unchecked BackupBuddy will cache command line zip testing for a few minutes so it does not run too often. This means that your backup status log may not always show the test results unless you disable caching.', 'it-l10n-backupbuddy') . '</span>', 'css' => '', 'after' => '<span class="description"> Check if you always want available zip methods to be tested and displayed<br> in backup log files. This is useful for support to see if command line zip is failing.</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'ignore_zip_warnings', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Ignore zip archive warnings', 'it-l10n-backupbuddy'), 'tip' => __('[Default: Disabled] When enabled BackupBuddy will ignore non-fatal warnings encountered during the backup process such as inability to read or access a file, symlink problems, etc. These non-fatal warnings will still be logged.', 'it-l10n-backupbuddy') . '</span>', 'css' => '', 'after' => '<span class="description"> Check to ignore non-fatal errors when zipping files.</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'zip_viewer_enabled', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Allow viewing zip contents (BETA)', 'it-l10n-backupbuddy'), 'tip' => __('[Default: Disabled] This feature is currently in beta. If your server supports ZipArchive, when enabled you may select to `View zip contents` from the backup listing on the Backups page. This allows you to view a listing of files within a ZIP archive.', 'it-l10n-backupbuddy'), 'css' => '', 'after' => '<span class="description"> ' . __('Check for Beta feature for viewing a list of files in an archive.', 'it-l10n-backupbuddy') . '</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'checkbox', 'name' => 'breakout_tables', 'options' => array('unchecked' => '0', 'checked' => '1'), 'title' => __('Break out big table dumps into steps (beta)', 'it-l10n-backupbuddy'), 'tip' => __('[Default: Disabled] Currently in beta. Breaks up some commonly known database tables to be backed up separately rather than all at once. Helps with larger databases.', 'it-l10n-backupbuddy') . '</span>', 'css' => '', 'after' => '<span class="description"> Check if you want some commonly known to be large tables dumped in<br> separate steps. This is useful for large databases if dumps are timing out.</span>', 'rules' => 'required'));
$settings_form->add_setting(array('type' => 'select', 'name' => 'backup_mode', 'title' => __('Manual backup mode', 'it-l10n-backupbuddy'), 'options' => array('1' => __('Classic (v1.x)', 'it-l10n-backupbuddy'), '2' => __('Modern (v2.x)', 'it-l10n-backupbuddy')), 'tip' => __('[Default: Modern] - If you are encountering difficulty backing up due to WordPress cron, HTTP Loopbacks, or other features specific to version 2.x you can try classic mode which runs like BackupBuddy v1.x did.', 'it-l10n-backupbuddy'), 'rules' => 'required'));
$settings_form->process();
// Handles processing the submitted form (if applicable).
$settings_form->set_value('importbuddy_pass_hash', $importbuddy_pass_dummy_text);
$settings_form->set_value('repairbuddy_pass_hash', $repairbuddy_pass_dummy_text);
$data['settings_form'] =& $settings_form;
// For use in view.
/* END CONFIGURING PLUGIN SETTINGS FORM */
flush();
pb_backupbuddy::$classes['core']->periodic_cleanup(43200, false);
// Cleans up and also makes sure directory security is always configured right on downloads after settings changes.
flush();
//$settings_form->clear_values();
// Load settings view.
pb_backupbuddy::load_view('settings', $data);
?>
示例2: htmlentities
$delete_after = false;
}
if ('1' == $submitted_schedule['data']['on_off']) {
$enabled = true;
} else {
$enabled = false;
}
if ($error === false) {
$add_response = backupbuddy_api::addSchedule($title = $submitted_schedule['data']['title'], $profile = $submitted_schedule['data']['profile'], $interval = $submitted_schedule['data']['interval'], $first_run = pb_backupbuddy::$format->unlocalize_time(strtotime($submitted_schedule['data']['first_run'])), $remote_destinations, $delete_after, $enabled);
if (true !== $add_response) {
pb_backupbuddy::alert('Error scheduling: ' . $add_response);
} else {
// Success
pb_backupbuddy::save();
$schedule_form->clear_values();
$schedule_form->set_value('on_off', 1);
pb_backupbuddy::alert('Added new schedule `' . htmlentities($submitted_schedule['data']['title']) . '`.');
}
}
} else {
// EDIT SCHEDULE. Form handles saving; just need to update timestamp.
$first_run = pb_backupbuddy::$format->unlocalize_time(strtotime($submitted_schedule['data']['first_run']));
if ($first_run == 0 || $first_run == 18000) {
pb_backupbuddy::alert(sprintf(__('Invalid time format. Please use the specified format / example %s', 'it-l10n-backupbuddy'), $date_format_example));
$error = true;
}
pb_backupbuddy::$options['schedules'][pb_backupbuddy::_GET('edit')]['first_run'] = $first_run;
//echo 'first: ' . $first_run;
$next_scheduled_time = wp_next_scheduled('backupbuddy_cron', array('run_scheduled_backup', array((int) $_GET['edit'])));
$result = backupbuddy_core::unschedule_event($next_scheduled_time, 'backupbuddy_cron', array('run_scheduled_backup', array((int) $_GET['edit'])));
// Remove old schedule. pb_backupbuddy::$options['schedules'][$_GET['edit']]['first_run']