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


PHP backupbuddy_core::_getBackupDirectoryDefault方法代碼示例

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


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

示例1: pb_backupbuddy_selectdestination

		
	});
	
	function pb_backupbuddy_selectdestination( destination_id, destination_title, callback_data, delete_after, mode ) {
		window.location.href = '<?php 
echo pb_backupbuddy::page_url();
?>
&custom=remoteclient&destination_id=' + destination_id;
	}
</script>
<?php 
/* BEGIN CONFIGURING PLUGIN SETTINGS FORM */
$settings_form = new pb_backupbuddy_settings('settings', '', 'tab=0', 350);
$settings_form->add_setting(array('type' => 'title', 'name' => 'title_general', 'title' => __('General', 'it-l10n-backupbuddy')));
$settings_form->add_setting(array('type' => 'password', 'name' => 'importbuddy_pass_hash', 'title' => __('ImportBuddy password', 'it-l10n-backupbuddy'), 'tip' => __('[Example: myp@ssw0rD] - Required password for running the ImportBuddy import/migration script. This prevents unauthorized access when using this tool. You should not use your WordPress password here.', 'it-l10n-backupbuddy'), 'value' => $importbuddy_pass_dummy_text, 'css' => 'width: 120px;', 'after' => '&nbsp;&nbsp; <span style="white-space: nowrap;">Confirm: <input style="width: 120px;" type="password" name="pb_backupbuddy_importbuddy_pass_hash_confirm" value="' . $importbuddy_pass_dummy_text . '"></span>'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'backup_directory', 'title' => __('Custom local storage directory', 'it-l10n-backupbuddy'), 'tip' => __('Leave blank for default. To customize, enter a full local path where all backup ZIP files will be saved to. This directory must have proper write and read permissions. Upon changing, any backups in the existing directory will be moved to the new directory. Note: This is only where local backups will be, not remotely stored backups. Remote storage is configured on the Remote Destinations page.', 'it-l10n-backupbuddy'), 'rules' => '', 'css' => 'width: 250px;', 'before' => '<span style="white-space: nowrap;">', 'after' => ' <span class="description">' . __('Blank for default', 'it-l10n-backupbuddy') . ':</span>&nbsp; <span class="code" style="background: #EAEAEA; white-space: normal;">' . backupbuddy_core::_getBackupDirectoryDefault() . '</span>'));
$settings_form->add_setting(array('type' => 'select', 'name' => 'role_access', 'title' => __('BackupBuddy access permission', 'it-l10n-backupbuddy'), 'options' => array('administrator' => __('Administrator (default)', 'it-l10n-backupbuddy'), 'moderate_comments' => __('Editor (moderate_comments)', 'it-l10n-backupbuddy'), 'edit_published_posts' => __('Author (edit_published_posts)', 'it-l10n-backupbuddy'), 'edit_posts' => __('Contributor (edit_posts)', 'it-l10n-backupbuddy')), 'tip' => __('[Default: Administrator] - Allow other user levels to access BackupBuddy. Use extreme caution as users granted access will have FULL access to BackupBuddy and your backups, including remote destinations. This is a potential security hole if used improperly. Use caution when selecting any other user roles or giving users in such roles access. Not applicable to Multisite installations.', 'it-l10n-backupbuddy'), 'after' => ' <span class="description">Use caution changing from "administrator".</span>', 'rules' => 'required'));
require_once '_email.php';
$settings_form->add_setting(array('type' => 'title', 'name' => 'title_archivestoragelimits', 'title' => __('Local Archive Storage Limits', 'it-l10n-backupbuddy') . ' ' . pb_backupbuddy::video('PmXLw_tS42Q#45', __('Archive Storage Limits Tutorial', 'it-l10n-backupbuddy'), false)));
$settings_form->add_setting(array('type' => 'text', 'name' => 'archive_limit', 'title' => __('Limit number of local backups to keep', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 10] - Maximum number of local archived backups to store (remote archive limits are configured per destination on their respective settings pages). Any new backups created after this limit is met will result in your oldest backup(s) being deleted to make room for the newer ones. 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-500]|int', 'css' => 'width: 50px;', 'after' => ' backups. <span class="description">0 for no limit.</span>'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'archive_limit_size', 'title' => __('Size limit of all local backups combined', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 350] - Maximum size (in MB) to allow your total local archives to reach (remote archive limits are configured per destination on their respective settings pages). Any new backups created after this limit is met will result in your oldest backup(s) being deleted to make room for the newer ones. 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-500]|int', 'css' => 'width: 50px;', 'after' => ' MB. <span class="description">0 for no limit.</span>'));
$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')));
開發者ID:arobbins,項目名稱:iab,代碼行數:30,代碼來源:_general.php

示例2: rtrim

    pb_backupbuddy::verify_nonce();
    if (call_user_func('pb_backupbuddy::reset_options', true) === true) {
        backupbuddy_core::verify_directories($skipTempGeneration = true);
        // Re-verify directories such as backup dir, temp, etc.
        //pb_backupbuddy::alert( 'Plugin settings have been reset to defaults.' );
        backupbuddy_core::addNotification('settings_reset', 'Plugin settigns reset', 'All plugin settings have been reset to defaults.');
    } else {
        pb_backupbuddy::alert('Unable to reset plugin settings. Verify you are running the latest version.');
    }
}
/* BEGIN VERIFYING BACKUP DIRECTORY */
if (isset($_POST['pb_backupbuddy_backup_directory'])) {
    $backup_directory = pb_backupbuddy::_POST('pb_backupbuddy_backup_directory');
    if ('' == $backup_directory) {
        // blank so set to default.
        $backup_directory = backupbuddy_core::_getBackupDirectoryDefault();
    }
    $backup_directory = str_replace('\\', '/', $backup_directory);
    $backup_directory = rtrim($backup_directory, '/\\') . '/';
    // Enforce single trailing slash.
    if (!is_dir($backup_directory)) {
        if (false === @mkdir($backup_directory, 0755)) {
            pb_backupbuddy::alert('Error #4838594589: Selected backup directory does not exist and it could not be created. Verify the path is correct or manually create the directory and set proper permissions. Reset to default path.');
            $_POST['pb_backupbuddy_backup_directory'] = backupbuddy_core::getBackupDirectory();
            // Set back to previous value (aka unchanged).
        }
    }
    if (backupbuddy_core::getBackupDirectory() != $backup_directory) {
        // Directory differs. Needs updated in post var. Give messages here as this value is going to end up being saved.
        pb_backupbuddy::anti_directory_browsing($backup_directory);
        $old_backup_dir = backupbuddy_core::getBackupDirectory();
開發者ID:shelbyneilsmith,項目名稱:wptools,代碼行數:31,代碼來源:settings.php


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