當前位置: 首頁>>代碼示例>>PHP>>正文


PHP pb_backupbuddy_settings::process方法代碼示例

本文整理匯總了PHP中pb_backupbuddy_settings::process方法的典型用法代碼示例。如果您正苦於以下問題:PHP pb_backupbuddy_settings::process方法的具體用法?PHP pb_backupbuddy_settings::process怎麽用?PHP pb_backupbuddy_settings::process使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pb_backupbuddy_settings的用法示例。


在下文中一共展示了pb_backupbuddy_settings::process方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: htmlentities

/*
	Pre-populated variables coming into this script:
		$destination_settings
		$mode
*/
global $pb_hide_test, $pb_hide_save;
$pb_hide_test = false;
$itxapi_username = '';
$itxapi_password = '';
if ($mode == 'add') {
    // ADD MODE.
    $credentials_form = new pb_backupbuddy_settings('pre_settings', false, 'action=pb_backupbuddy_backupbuddy&function=destination_picker&quickstart=' . htmlentities(pb_backupbuddy::_GET('quickstart')) . '&add=' . htmlentities(pb_backupbuddy::_GET('add')) . '&callback_data=' . htmlentities(pb_backupbuddy::_GET('callback_data')) . '&sending=' . pb_backupbuddy::_GET('sending'));
    // name, savepoint|false, additional querystring
    $credentials_form->add_setting(array('type' => 'text', 'name' => 'itxapi_username', 'title' => __('iThemes username', 'it-l10n-backupbuddy'), 'tip' => __('[Example: kerfuffle] - Your iThemes.com / PluginBuddy membership username.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-45]'));
    $credentials_form->add_setting(array('type' => 'password', 'name' => 'itxapi_password_raw', 'title' => __('iThemes password', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 48dsds!s08K%x2s] - Your iThemes.com / PluginBuddy membership password.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-250]'));
    $settings_result = $credentials_form->process();
    $login_welcome = __('Log in with your iThemes.com member account to begin.', 'it-l10n-backupbuddy');
    if (count($settings_result) == 0) {
        // No form submitted.
        echo $login_welcome;
        $credentials_form->display_settings('Submit');
        $pb_hide_test = true;
        $pb_hide_save = true;
        return;
    } else {
        // Form submitted.
        if (count($settings_result['errors']) > 0) {
            // Form errors.
            echo $login_welcome;
            pb_backupbuddy::alert(implode('<br>', $settings_result['errors']));
            $credentials_form->display_settings('Submit');
開發者ID:emjayoh,項目名稱:bhag,代碼行數:31,代碼來源:_configure.php

示例2: trim

    $settings_form->add_setting(array('type' => 'title', 'name' => 'title_files', 'title' => __('Files & Directories', 'it-l10n-backupbuddy')));
    require_once pb_backupbuddy::plugin_path() . '/views/settings/_files.php';
}
require_once pb_backupbuddy::plugin_path() . '/views/settings/_profiles-advanced.php';
// 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;
        ?>
開發者ID:elephantcode,項目名稱:elephantcode,代碼行數:31,代碼來源:_includeexclude.php

示例3: date

} else {
    $mode = 'add';
    $data['mode_title'] = __('Add New Schedule', 'it-l10n-backupbuddy');
    $savepoint = false;
    $first_run_value = date('m/d/Y h:i a', time() + (get_option('gmt_offset') * 3600 + 86400));
    $remote_destinations = '<ul id="pb_backupbuddy_remotedestinations_list"></ul>';
}
$schedule_form = new pb_backupbuddy_settings('scheduling', $savepoint, 'edit=' . pb_backupbuddy::_GET('edit'), 250);
$schedule_form->add_setting(array('type' => 'text', 'name' => 'title', 'title' => 'Schedule name', 'tip' => __('This is a name for your reference only.', 'it-l10n-backupbuddy'), 'rules' => 'required'));
$schedule_form->add_setting(array('type' => 'radio', 'name' => 'type', 'title' => 'Backup type', 'options' => array('db' => 'Database only', 'full' => 'Full backup'), 'tip' => __('Full backups contain all files (except exclusions) and your database. Database only backups consist of an export of your mysql database; no WordPress files or media. Database backups are typically much smaller and faster to perform and are typically the most quickly changing part of a site.', 'it-l10n-backupbuddy'), 'rules' => 'required'));
$schedule_form->add_setting(array('type' => 'select', 'name' => 'interval', 'title' => 'Backup interval', 'options' => array('monthly' => 'Monthly', 'twicemonthly' => 'Twice Monthly', 'weekly' => 'Weekly', 'daily' => 'Daily', 'hourly' => 'Hourly'), 'tip' => __('Time period between backups.', 'it-l10n-backupbuddy'), 'rules' => 'required'));
$schedule_form->add_setting(array('type' => 'text', 'name' => 'first_run', 'title' => 'Date/time of next run', 'tip' => __('IMPORTANT: For scheduled events to occur someone (or you) must visit this site on or after the scheduled time. If no one visits your site for a long period of time some backup events may not be triggered.', 'it-l10n-backupbuddy'), 'rules' => 'required', 'default' => $first_run_value, 'after' => ' ' . __('Currently', 'it-l10n-backupbuddy') . ' <code>' . date('m/d/Y h:i a ' . get_option('gmt_offset'), time() + get_option('gmt_offset') * 3600) . ' UTC</code> ' . __('based on', 'it-l10n-backupbuddy') . ' <a href="' . admin_url('options-general.php') . '">' . __('WordPress settings', 'it-l10n-backupbuddy') . '</a>.'));
$schedule_form->add_setting(array('type' => 'text', 'name' => 'remote_destinations', 'title' => 'Remote backup destination', 'rules' => '', 'css' => 'display: none;', 'after' => $remote_destinations . '<a href="' . pb_backupbuddy::ajax_url('destination_picker') . '&#038;TB_iframe=1&#038;width=640&#038;height=600" class="thickbox button secondary-button" style="margin-top: 3px;" title="' . __('Select a Destination', 'it-l10n-backupbuddy') . '">' . __('+ Add Remote Destination', 'it-l10n-backupbuddy') . '</a>'));
$schedule_form->add_setting(array('type' => 'checkbox', 'name' => 'delete_after', 'title' => 'Delete local backup after remote send?', 'options' => array('checked' => '1', 'unchecked' => '0'), 'rules' => ''));
// PROCESS ADDING SCHEDULE.
$submitted_schedule = $schedule_form->process();
// Handles processing the submitted form (if applicable).
if ($submitted_schedule != '' && count($submitted_schedule['errors']) == 0) {
    // ADD SCHEDULE.
    if (pb_backupbuddy::_GET('edit') == '') {
        $error = false;
        $schedule = pb_backupbuddy::settings('schedule_defaults');
        $schedule['title'] = $submitted_schedule['data']['title'];
        if (isset($submitted_schedule['data']['type'])) {
            $schedule['type'] = $submitted_schedule['data']['type'];
        }
        $schedule['interval'] = $submitted_schedule['data']['interval'];
        $schedule['first_run'] = pb_backupbuddy::$format->unlocalize_time(strtotime($submitted_schedule['data']['first_run']));
        if ($schedule['first_run'] == 0 || $schedule['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;
開發者ID:verbazend,項目名稱:AWFA,代碼行數:31,代碼來源:scheduling.php

示例4: htmlentities

&picker_type=local&callback_data=<?php 
    echo htmlentities(pb_backupbuddy::_GET('callback_data'));
    ?>
&migrate=1" class="pb_backupbuddy_big_button">
		Copy to a local file path on this server
	</a>
<?php 
} elseif (pb_backupbuddy::_GET('picker_type') == 'local') {
    ?>
	<h3>Automated Migration - Copy to local path</h3>
	<?php 
    $settings_form = new pb_backupbuddy_settings('settings', false, 'action=pb_backupbuddy_migration_picker&picker_type=local&callback_data=' . htmlentities(pb_backupbuddy::_GET('callback_data')) . '&migrate=1', 200);
    // form name, savepoint, additional query, custom title width
    $settings_form->add_setting(array('type' => 'text', 'name' => 'path', 'title' => __('Local file path', 'it-l10n-backupbuddy'), 'tip' => __('Provide the full path to the location to migrate the site to. This must map to the web location for the destination URL.', 'it-l10n-backupbuddy'), 'default' => ABSPATH, 'css' => 'width: 375px;', 'rules' => 'required|string[1-500]'));
    $settings_form->add_setting(array('type' => 'text', 'name' => 'url', 'title' => __('Destination site URL*', 'it-l10n-backupbuddy'), 'tip' => __('Enter the URL corresponding to the local destination selected on the previous page. This URL must lead to the location where files uploaded to this remote destination would end up. If the destination is in a subdirectory make sure to include it in the corresponding URL.', 'it-l10n-backupbuddy'), 'default' => site_url(), 'css' => 'width: 375px;', 'rules' => '', 'after' => '<p><a class="button button-secondary pb_backupbuddy_remotetest" id="pb_backupbuddy_remotetest_local" alt="' . pb_backupbuddy::ajax_url('remote_test') . '&service=local">' . __('Test these settings', 'it-l10n-backupbuddy') . '</a><span class="pb_backupbuddy_loading" style="display: none; margin-left: 10px;"><img src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" alt="' . __('Loading...', 'it-l10n-backupbuddy') . '" title="' . __('Loading...', 'it-l10n-backupbuddy') . '" width="16" height="16" style="vertical-align: -3px;"></span></p>'));
    $submitted_settings = $settings_form->process();
    // Handles processing the submitted form (if applicable).
    if ($submitted_settings != '' && count($submitted_settings['errors']) == 0) {
        $fail = false;
        if (!file_exists($submitted_settings['data']['path'])) {
            pb_backupbuddy::$filesystem->mkdir($submitted_settings['data']['path']);
        }
        if (!is_writable($submitted_settings['data']['path']) === true) {
            $fail .= 'The path does not allow writing. Please verify write file permissions.';
        }
        if ($fail === false) {
            $destination = pb_backupbuddy::settings('local_destination_defaults');
            $destination['title'] = '(temporary migration destination)';
            $destination['path'] = $submitted_settings['data']['path'];
            $destination['url'] = $submitted_settings['data']['url'];
            $destination['type'] = 'local';
開發者ID:verbazend,項目名稱:AWFA,代碼行數:31,代碼來源:_migration_picker.php

示例5: path

		</script>
		<?php 
    }
}
wp_enqueue_script('thickbox');
wp_print_scripts('thickbox');
wp_print_styles('thickbox');
pb_backupbuddy::$ui->title(__('Restore / Migrate', 'it-l10n-backupbuddy'));
/********* Begin Migrate Settings Form *********/
$migrate_form = new pb_backupbuddy_settings('migrate', false, '', 200);
// form_name, savepoint, action_destination, title_width
$migrate_form->add_setting(array('type' => 'text', 'name' => 'web_address', 'title' => __('Website address', 'it-l10n-backupbuddy'), 'tip' => __('Website address that corresponds to the FTP path.ß', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-500]', 'default' => 'http://', 'css' => 'width: 200px;', 'after' => ' <span class="description">(ftp path must correspond to this address)</span>'));
$migrate_form->add_setting(array('type' => 'text', 'name' => 'ftp_server', 'title' => __('FTP server address', 'it-l10n-backupbuddy'), 'tip' => __('FTP server address. This must correspond to the website address URL, including path, to the destination site.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-500]', 'css' => 'width: 200px;'));
$migrate_form->add_setting(array('type' => 'text', 'name' => 'ftp_username', 'title' => __('FTP username', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-500]', 'css' => 'width: 200px;'));
$migrate_form->add_setting(array('type' => 'text', 'name' => 'ftp_password', 'title' => __('FTP password', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-500]', 'css' => 'width: 200px;'));
$migrate_form->add_setting(array('type' => 'text', 'name' => 'ftp_path', 'title' => __('FTP remote path (optional)', 'it-l10n-backupbuddy'), 'tip' => __('This is the remote path / directory for the server. You may use an FTP client to connect to your FTP to determine the exact path.', 'it-l10n-backupbuddy'), 'rules' => 'required|string[1-500]', 'after' => ' <span class="description">(must correspond to website address)</span>', 'css' => 'width: 200px;'));
$migrate_form->add_setting(array('type' => 'checkbox', 'name' => 'ftps', 'title' => __('Use FTPs encryption', 'it-l10n-backupbuddy'), 'options' => array('unchecked' => '0', 'checked' => '1'), 'rules' => 'required'));
$result = $migrate_form->process();
// Handles processing the submitted form (if applicable).
echo '<pre>' . print_r($result, true) . '</pre>';
if (count($result['errors']) > 0) {
    // Form errors.
} else {
    // No errors.
}
$view_data['migrate_form'] =& $migrate_form;
// For use in view.
/********* End Migrate Settings Form *********/
// Load view.
$view_data['backups'] = backupbuddy_core::backups_list('migrate');
pb_backupbuddy::load_view('migrate-home', $view_data);
開發者ID:Coop920,項目名稱:Sterling-Wellness,代碼行數:31,代碼來源:migrate_restore.php

示例6: array

	'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 */





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.

//$settings_form->clear_values();

開發者ID:verbazend,項目名稱:AWFA,代碼行數:29,代碼來源:settings.php


注:本文中的pb_backupbuddy_settings::process方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。