• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pb_backupbuddy_destinations类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中pb_backupbuddy_destinations的典型用法代码示例。如果您正苦于以下问题:PHP pb_backupbuddy_destinations类的具体用法?PHP pb_backupbuddy_destinations怎么用?PHP pb_backupbuddy_destinations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了pb_backupbuddy_destinations类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: run

 public function run($arguments)
 {
     $arguments = Ithemes_Sync_Functions::merge_defaults($arguments, $this->default_arguments);
     require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
     if (true === ($results = pb_backupbuddy_destinations::test($settings))) {
         return array('api' => '0', 'status' => 'ok', 'message' => 'Supported destinations retrieved.');
     } else {
         return array('api' => '0', 'status' => 'error', 'message' => $results);
     }
 }
开发者ID:elephantcode,项目名称:elephantcode,代码行数:10,代码来源:backupbuddy-test-destination.php


示例2: test

 public static function test($settings)
 {
     /*
     if ( ( $settings['address'] == '' ) || ( $settings['username'] == '' ) || ( $settings['password'] == '' ) ) {
     	return __('Missing required input.', 'it-l10n-backupbuddy' );
     }
     */
     // Try sending a file.
     return pb_backupbuddy_destinations::send($settings, dirname(dirname(__FILE__)) . '/remote-send-test.php', $send_id = 'TEST-' . pb_backupbuddy::random_string(12));
     // 3rd param true forces clearing of any current uploads.
 }
开发者ID:Offirmo,项目名称:base-wordpress,代码行数:11,代码来源:init.php


示例3: run

 public function run($arguments)
 {
     $arguments = Ithemes_Sync_Functions::merge_defaults($arguments, $this->default_arguments);
     require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
     $response = pb_backupbuddy_destinations::delete($arguments['id'], true);
     if (true === $response) {
         return array('api' => '0', 'status' => 'ok', 'message' => 'Destination deleted.');
     } else {
         return array('api' => '0', 'status' => 'error', 'message' => 'Error #384783783: Failure deleting destination.');
     }
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:11,代码来源:backupbuddy-delete-destination.php


示例4: foreach

                backupbuddy_core::mail_error($message);
            }
        }
    }
}
// Cleanup remote S3 multipart chunking.
foreach (pb_backupbuddy::$options['remote_destinations'] as $destination) {
    if ($destination['type'] != 's3') {
        continue;
    }
    if (isset($destination['max_chunk_size']) && $destination['max_chunk_size'] == '0') {
        continue;
    }
    pb_backupbuddy::status('details', 'Found S3 Multipart Chunking Destinations to cleanup.');
    require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
    $cleanup_result = pb_backupbuddy_destinations::multipart_cleanup($destination);
    /*
    if ( true === $cleanup_result ) {
    	pb_backupbuddy::status( 'details', 'S3 Multipart Chunking Cleanup Success.' );
    } else {
    	pb_backupbuddy::status( 'error', 'S3 Multipart Chunking Cleanup FAILURE. Manually cleanup stalled multipart send via S3 or try again later.' );
    }
    */
}
// Clean up any temp rollback or deployment database tables.
backupbuddy_core::cleanup_temp_tables();
// Cleanup any cron schedules pointing to non-existing schedules.
$cron = get_option('cron');
// Loop through each cron time to create $crons array for displaying later.
$crons = array();
foreach ((array) $cron as $time => $cron_item) {
开发者ID:Offirmo,项目名称:base-wordpress,代码行数:31,代码来源:_periodicCleanup.php


示例5: process_destination_copy

 function process_destination_copy($destination_settings, $remote_file, $fileID = '')
 {
     pb_backupbuddy::set_greedy_script_limits();
     if (!class_exists('backupbuddy_core')) {
         require_once pb_backupbuddy::plugin_path() . '/classes/core.php';
     }
     require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
     $local_file = backupbuddy_core::getBackupDirectory() . basename($remote_file);
     if (file_exists(basename($local_file))) {
         $local_file = str_replace('backup-', 'backup_copy_' . pb_backupbuddy::random_string(5) . '-', $local_file);
     }
     if ($fileID != '') {
         $remote_file = $fileID;
     }
     if (true === pb_backupbuddy_destinations::getFile($destination_settings, $remote_file, $local_file)) {
         pb_backupbuddy::status('message', 'Success copying remote file to local.');
         return true;
     } else {
         pb_backupbuddy::status('error', 'Failure copying remote file to local.');
         return false;
     }
 }
开发者ID:elephantcode,项目名称:elephantcode,代码行数:22,代码来源:cron.php


示例6: foreach

    $url = pb_backupbuddy::ajax_url('remoteClient') . '&destination_id=' . $destination_id;
    echo '<iframe id="pb_backupbuddy_iframe-dest-' . $destination_id . '" src="' . $url . '" width="100%" height="3000" frameBorder="0">Error #4584594579. Browser not compatible with iframes.</iframe>';
    echo '</div>';
    pb_backupbuddy::$ui->end_tab();
}
pb_backupbuddy::$ui->start_tab('add_new');
$destination_type = pb_backupbuddy::_GET('add');
require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
?>
	<div class="bb_destinations" style="display: block; margin: 0;">
		<div class="bb_destinations-group bb_destinations-new" style="display: block;">
			<h3>What kind of destination do you want to add?</h3>
			<ul>
				<?php 
$i = 0;
foreach (pb_backupbuddy_destinations::get_destinations_list($showUnavailable = true) as $destination_name => $destination) {
    $i++;
    if (true === $destination['compatible']) {
        echo '<li class="bb_destination-item bb_destination-' . $destination_name . ' bb_destination-new-item">';
        /*
        if ( 's32' == $destination_name ) {
        	echo '<div class="bb-ribbon"><span>New</span></div>';
        }
        */
        if ('stash2' == $destination_name) {
            echo '<div class="bb-ribbon"><span>New</span></div>';
        }
        echo '<a href="javascript:void(0)" rel="' . $destination_name . '">';
        echo $destination['name'];
        echo '</a></li>';
    } else {
开发者ID:AgilData,项目名称:WordPress-Skeleton,代码行数:31,代码来源:destinationTabs.php


示例7: pb_bb_add_box

function pb_bb_add_box($mode, $picker_url, $hideBack = false)
{
    ?>
	<div class="bb_destinations-group bb_destinations-new">
		<h3>What kind of destination do you want to add?</h3>
		<ul>
			<?php 
    $i = 0;
    foreach (pb_backupbuddy_destinations::get_destinations_list() as $destination_name => $destination) {
        if ($mode == 'migration') {
            if ($destination_name != 'local' && $destination_name != 'ftp' && $destination_name != 'sftp') {
                // if not local or ftp when in migration mode then skip.
                continue;
            }
        }
        // Filter only showing certain destination type.
        if ('' != pb_backupbuddy::_GET('filter')) {
            if ($destination_name != pb_backupbuddy::_GET('filter')) {
                continue;
                // Move along to next destination.
            }
        }
        $i++;
        echo '<li class="bb_destination-item bb_destination-' . $destination_name . ' bb_destination-new-item"><a href="' . $picker_url . '&add=' . $destination_name . '&callback_data=' . pb_backupbuddy::_GET('callback_data') . '&sending=' . pb_backupbuddy::_GET('sending') . '" rel="' . $destination_name . '">' . $destination['name'] . '</a></li>';
        if ($i >= 5) {
            echo '<span class="bb_destination-break"></span>';
            $i = 0;
        }
    }
    if (false === $hideBack) {
        ?>
				<br><br>
				<a href="javascript:void(0)" class="btn btn-small btn-white btn-with-icon btn-back btn-back-add"  onClick="jQuery('.bb_destinations-new').hide(); jQuery('.bb_destinations-existing').show();"><span class="btn-icon"></span>Back to existing destinations</a>
			<?php 
    }
    ?>
		</ul>
	</div>
	<?php 
}
开发者ID:emjayoh,项目名称:bhag,代码行数:40,代码来源:_destination_picker.php


示例8: die

// Delete local copy after send completes?
if (pb_backupbuddy::_POST('delete_after') == 'true') {
    $delete_after = true;
    pb_backupbuddy::status('details', 'Remote send set to delete after successful send.');
} else {
    $delete_after = false;
    pb_backupbuddy::status('details', 'Remote send NOT set to delete after successful send.');
}
if (!isset(pb_backupbuddy::$options['remote_destinations'][$destination_id])) {
    die('Error #833383: Invalid destination ID `' . htmlentities($destination_id) . '`.');
}
// For Stash we will check the quota prior to initiating send.
if (pb_backupbuddy::$options['remote_destinations'][$destination_id]['type'] == 'stash') {
    // Pass off to destination handler.
    require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
    $send_result = pb_backupbuddy_destinations::get_info('stash');
    // Used to kick the Stash destination into life.
    $stash_quota = pb_backupbuddy_destination_stash::get_quota(pb_backupbuddy::$options['remote_destinations'][$destination_id], true);
    if (isset($stash_quota['error'])) {
        echo ' Error accessing Stash account. Send aborted. Details: `' . implode(' - ', $stash_quota['error']) . '`.';
        die;
    }
    if ($backup_file != '') {
        $backup_file_size = filesize($backup_file);
    } else {
        $backup_file_size = 50000;
    }
    if ($backup_file_size + $stash_quota['quota_used'] > $stash_quota['quota_total']) {
        echo "You do not have enough Stash storage space to send this file. Please upgrade your Stash storage or delete files to make space.\n\n";
        echo 'Attempting to send file of size ' . pb_backupbuddy::$format->file_size($backup_file_size) . ' but you only have ' . $stash_quota['quota_available_nice'] . ' available. ';
        echo 'Currently using ' . $stash_quota['quota_used_nice'] . ' of ' . $stash_quota['quota_total_nice'] . ' (' . $stash_quota['quota_used_percent'] . '%).';
开发者ID:AgilData,项目名称:WordPress-Skeleton,代码行数:31,代码来源:remote_send.php


示例9: die

<?php

if (!is_admin()) {
    die('Access denied.');
}
/* remote_delete()
*
* description
*
*/
pb_backupbuddy::verify_nonce();
// Security check.
// Destination ID.
$destination_id = pb_backupbuddy::_GET('pb_backupbuddy_destinationid');
// Delete the destination.
require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
$delete_response = pb_backupbuddy_destinations::delete_destination($destination_id, true);
// Response.
if ($delete_response !== true) {
    // Some kind of error so just echo it.
    echo 'Error #544558: `' . $delete_response . '`.';
} else {
    // Success.
    echo 'Destination deleted.';
}
die;
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:26,代码来源:remote_delete.php


示例10: test

 public static function test($settings)
 {
     $settings = self::_init($settings);
     // Try sending a file.
     $send_response = pb_backupbuddy_destinations::send($settings, dirname(dirname(__FILE__)) . '/remote-send-test.php', $send_id = 'TEST-' . pb_backupbuddy::random_string(12));
     // 3rd param true forces clearing of any current uploads.
     if (false === $send_response) {
         $send_response = 'Error sending test file to S3.';
     } else {
         $send_response = 'Success.';
     }
     // Delete sent file.
     $delete_response = 'Success.';
     try {
         $delete_response = self::$_client->delete_object(array('Bucket' => $settings['bucket'], 'Key' => $settings['directory'] . 'remote-send-test.php'));
         $delete_response = 'Success.';
     } catch (Exception $e) {
         pb_backupbuddy::status('details', 'Unable to delete test S3 file `remote-send-test.php`. Details: `' . $e->getMessage() . '`.');
     }
     // Load destination fileoptions.
     pb_backupbuddy::status('details', 'About to load fileoptions data.');
     require_once pb_backupbuddy::plugin_path() . '/classes/fileoptions.php';
     pb_backupbuddy::status('details', 'Fileoptions instance #7.');
     $fileoptions_obj = new pb_backupbuddy_fileoptions(backupbuddy_core::getLogDirectory() . 'fileoptions/send-' . $send_id . '.txt', $read_only = false, $ignore_lock = false, $create_file = false);
     if (true !== ($result = $fileoptions_obj->is_ok())) {
         return self::_error(__('Fatal Error #9034.84838. Unable to access fileoptions data.', 'it-l10n-backupbuddy') . ' Error: ' . $result);
     }
     pb_backupbuddy::status('details', 'Fileoptions data loaded.');
     $fileoptions =& $fileoptions_obj->options;
     if ('Success.' != $send_response || 'Success.' != $delete_response) {
         $fileoptions['status'] = 'failure';
         $fileoptions_obj->save();
         unset($fileoptions_obj);
         return 'Send details: `' . $send_response . '`. Delete details: `' . $delete_response . '`.';
     } else {
         $fileoptions['status'] = 'success';
         $fileoptions['finish_time'] = time();
     }
     $fileoptions_obj->save();
     unset($fileoptions_obj);
     return true;
 }
开发者ID:shelbyneilsmith,项目名称:wptools,代码行数:42,代码来源:init.php


示例11: periodic_cleanup


//.........这里部分代码省略.........
             pb_backupbuddy::status('details', 'Unlinked importbuddy.php in root of site.');
             unlink(ABSPATH . 'importbuddy.php');
         } else {
             pb_backupbuddy::status('details', 'SKIPPED unlinking importbuddy.php in root of site as it is fresh and may still be in use.');
         }
     }
     // Remove any copy of importbuddy directory in root.
     pb_backupbuddy::status('details', 'Cleaning up importbuddy directory in site root if it exists & is not very recent.');
     if (file_exists(ABSPATH . 'importbuddy/')) {
         $modified = filemtime(ABSPATH . 'importbuddy/');
         if (FALSE === $modified || time() > $modified + $max_importbuddy_age) {
             // If time modified unknown OR was modified long enough ago.
             pb_backupbuddy::status('details', 'Unlinked importbuddy directory recursively in root of site.');
             pb_backupbuddy::$filesystem->unlink_recursive(ABSPATH . 'importbuddy/');
         } else {
             pb_backupbuddy::status('details', 'SKIPPED unlinked importbuddy directory recursively in root of site as it is fresh and may still be in use.');
         }
     }
     // Remove any old temporary directories in wp-content/uploads/backupbuddy_temp/. Logs any directories it cannot delete.
     pb_backupbuddy::status('details', 'Cleaning up any old temporary zip directories in: wp-content/uploads/backupbuddy_temp/');
     $temp_directory = WP_CONTENT_DIR . '/uploads/backupbuddy_temp/';
     $files = glob($temp_directory . '*');
     if (is_array($files) && !empty($files)) {
         // For robustness. Without open_basedir the glob() function returns an empty array for no match. With open_basedir in effect the glob() function returns a boolean false for no match.
         foreach ($files as $file) {
             if (strpos($file, 'index.') !== false || strpos($file, '.htaccess') !== false) {
                 // Index file or htaccess dont get deleted so go to next file.
                 continue;
             }
             $file_stats = stat($file);
             if (0 == $backup_age_limit || time() - $file_stats['mtime'] > $backup_age_limit) {
                 // If older than 12 hours, delete the log.
                 if (@pb_backupbuddy::$filesystem->unlink_recursive($file) === false) {
                     pb_backupbuddy::status('error', 'Unable to clean up (delete) temporary directory/file: `' . $file . '`. You should manually delete it or check permissions.');
                 }
             }
         }
     }
     // Cleanup any temp files from a failed restore within WordPress. (extract file feature).
     $temp_dir = get_temp_dir();
     pb_backupbuddy::status('details', 'Cleaning up temporary files from individual file / directory restores in directory `' . $temp_dir . '`...');
     $possibly_temp_restore_dirs = glob($temp_dir . 'backupbuddy-*');
     if (!is_array($possibly_temp_restore_dirs)) {
         $possibly_temp_restore_dirs = array();
     }
     foreach ($possibly_temp_restore_dirs as $possibly_temp_restore_dir) {
         if (false === pb_backupbuddy::$filesystem->unlink_recursive($possibly_temp_restore_dir)) {
             // Delete.
             pb_backupbuddy::status('details', 'Unable to delete temporary holding directory `' . $possibly_temp_restore_dir . '`.');
         } else {
             pb_backupbuddy::status('details', 'Cleaned up temporary files.');
         }
     }
     pb_backupbuddy::status('details', 'Individual file / directory restore cleanup complete.');
     // Remove any old temporary zip directories: wp-content/uploads/backupbuddy_backups/temp_zip_XXXX/. Logs any directories it cannot delete.
     pb_backupbuddy::status('details', 'Cleaning up any old temporary zip directories in backup directory temp location `' . backupbuddy_core::getBackupDirectory() . 'temp_zip_XXXX/`.');
     // $temp_directory = WP_CONTENT_DIR . '/uploads/backupbuddy_backups/temp_zip_*';
     $temp_directory = backupbuddy_core::getBackupDirectory() . 'temp_zip_*';
     $files = glob($temp_directory . '*');
     if (is_array($files) && !empty($files)) {
         // For robustness. Without open_basedir the glob() function returns an empty array for no match. With open_basedir in effect the glob() function returns a boolean false for no match.
         foreach ($files as $file) {
             if (strpos($file, 'index.') !== false || strpos($file, '.htaccess') !== false) {
                 // Index file or htaccess dont get deleted so go to next file.
                 continue;
             }
             $file_stats = stat($file);
             if (time() - $file_stats['mtime'] > $backup_age_limit) {
                 // If older than 12 hours, delete the log.
                 if (@pb_backupbuddy::$filesystem->unlink_recursive($file) === false) {
                     $message = 'BackupBuddy was unable to clean up (delete) temporary directory/file: `' . $file . '`. You should manually delete it and/or verify proper file permissions to allow BackupBuddy to clean up for you.';
                     pb_backupbuddy::status('error', $message);
                     self::mail_error($message);
                 }
             }
         }
     }
     // Cleanup remote S3 multipart chunking.
     foreach (pb_backupbuddy::$options['remote_destinations'] as $destination) {
         if ($destination['type'] != 's3') {
             continue;
         }
         if (isset($destination['max_chunk_size']) && $destination['max_chunk_size'] == '0') {
             continue;
         }
         pb_backupbuddy::status('details', 'Found S3 Multipart Chunking Destinations to cleanup.');
         require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
         $cleanup_result = pb_backupbuddy_destinations::multipart_cleanup($destination);
         /*
         if ( true === $cleanup_result ) {
         	pb_backupbuddy::status( 'details', 'S3 Multipart Chunking Cleanup Success.' );
         } else {
         	pb_backupbuddy::status( 'error', 'S3 Multipart Chunking Cleanup FAILURE. Manually cleanup stalled multipart send via S3 or try again later.' );
         }
         */
     }
     @clearstatcache();
     // Clears file info stat cache.
     pb_backupbuddy::status('message', 'Finished cleanup procedure.');
 }
开发者ID:netfor,项目名称:nextrading,代码行数:101,代码来源:core.php


示例12: network_admin_url

<?php

backupbuddy_core::verifyAjaxAccess();
pb_backupbuddy::$ui->ajax_header();
if (isset(pb_backupbuddy::$options['remote_destinations'][pb_backupbuddy::_GET('destination_id')])) {
    $destination = pb_backupbuddy::$options['remote_destinations'][$_GET['destination_id']];
} else {
    echo 'Error #438934894349. Invalid destination ID `' . pb_backupbuddy::_GET('destination_id') . '`.';
    return;
}
require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
pb_backupbuddy_destinations::manage($destination, $_GET['destination_id']);
/*
echo '<br><br><br>';
echo '<a class="button" href="';
if ( is_network_admin() ) {
	echo network_admin_url( 'admin.php' );
} else {
	echo admin_url( 'admin.php' );
}
echo '?page=pb_backupbuddy_destinations">&larr; back to destinations</a><br><br>';
*/
pb_backupbuddy::$ui->ajax_footer();
die;
开发者ID:elephantcode,项目名称:elephantcode,代码行数:24,代码来源:remoteClient.php


示例13: run

 public function run($arguments)
 {
     $arguments = Ithemes_Sync_Functions::merge_defaults($arguments, $this->default_arguments);
     require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
     return array('api' => '0', 'status' => 'ok', 'message' => 'Supported destinations retrieved.', 'destinations' => pb_backupbuddy_destinations::get_destinations_list());
 }
开发者ID:elephantcode,项目名称:elephantcode,代码行数:6,代码来源:backupbuddy-list-destinationTypes.php


示例14: s32_cancel_multipart_pieces

 public static function s32_cancel_multipart_pieces()
 {
     foreach (pb_backupbuddy::$options['remote_destinations'] as $destination) {
         if ($destination['type'] != 's32') {
             continue;
         }
         pb_backupbuddy::status('details', 'Found S32 Multipart Chunking Destinations to cleanup.');
         require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
         $cleanup_result = pb_backupbuddy_destinations::multipart_cleanup($destination);
         if (true === $cleanup_result) {
             pb_backupbuddy::status('details', 'S32 Multipart Chunking Cleanup Success.');
         } else {
             pb_backupbuddy::status('warning', 'Warning #2389328: S32 Multipart Chunking Cleanup FAILURE. Manually cleanup stalled multipart send via S3 or try again later.');
         }
     }
 }
开发者ID:arobbins,项目名称:spellestate,代码行数:16,代码来源:housekeeping.php


示例15: __

<?php

backupbuddy_core::verifyAjaxAccess();
pb_backupbuddy::$ui->ajax_header($js = true, $padding = true);
require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
require_once pb_backupbuddy::plugin_path() . '/destinations/live/live.php';
require_once pb_backupbuddy::plugin_path() . '/destinations/live/live_periodic.php';
$destination_id = backupbuddy_live::getLiveID();
$destination_settings = backupbuddy_live_periodic::get_destination_settings();
echo '<h2>' . __('BackupBuddy Stash Live Settings', 'it-l10n-backupbuddy') . '</h2>';
// Settings form setup.
$settings_form = pb_backupbuddy_destinations::configure($destination_settings, $mode = 'edit', $destination_id, $url = pb_backupbuddy::ajax_url('live_settings'));
// Process saving.
if ('' != pb_backupbuddy::_POST('pb_backupbuddy_')) {
    pb_backupbuddy::verify_nonce();
    $save_result = $settings_form->process();
    if (count($save_result['errors']) == 0) {
        // NO ERRORS SO SAVE.
        pb_backupbuddy::$options['remote_destinations'][$destination_id] = array_merge(pb_backupbuddy::$options['remote_destinations'][$destination_id], $save_result['data']);
        pb_backupbuddy::save();
        pb_backupbuddy::alert(__('Settings saved. Restarting Live process so they take immediate effect.', 'it-l10n-backupbuddy'));
        set_transient('backupbuddy_live_jump', array('daily_init', array()), 60 * 60 * 48);
        // Tells Live process to restart from the beginning (if mid-process) so new settigns apply.
        // Add final entry to log if disabled
        if ($destination_settings['disable_logging'] == 0 && $save_result['data']['disable_logging'] == 1) {
            $previous_status_serial = pb_backupbuddy::get_status_serial();
            // Hold current serial.
            pb_backupbuddy::set_status_serial('live_periodic');
            // Redirect logging output to a certain log file.
            pb_backupbuddy::status('details', '-----');
            pb_backupbuddy::status('details', 'Logging disabled in Stash Live --> Settings --> Advanced.');
开发者ID:arobbins,项目名称:spellestate,代码行数:31,代码来源:live_settings.php


示例16: __

<?php

if (isset(pb_backupbuddy::$options['remote_destinations'][$_GET['destination_id']])) {
    $destination =& pb_backupbuddy::$options['remote_destinations'][$_GET['destination_id']];
} else {
    echo __('Error #438934894349. Invalid destination ID.', 'it-l10n-backupbuddy');
    return;
}
require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
pb_backupbuddy_destinations::manage($destination);
echo '<br><br><br>';
echo '<a class="button" href="';
if (is_network_admin()) {
    echo network_admin_url('admin.php');
} else {
    echo admin_url('admin.php');
}
echo '?page=pb_backupbuddy_destinations">&larr; back to destinations</a><br><br>';
开发者ID:FelixNong1990,项目名称:andy,代码行数:18,代码来源:_remote_client.php


示例17: test

 public static function test($settings)
 {
     $settings = self::_init($settings);
     $sendOK = false;
     $deleteOK = false;
     $send_id = 'TEST-' . pb_backupbuddy::random_string(12);
     // Try sending a file.
     if ('1' == $settings['stash_mode']) {
         // Stash mode.
         $settings['type'] = 'stash2';
     }
     $send_response = pb_backupbuddy_destinations::send($settings, dirname(dirname(__FILE__)) . '/remote-send-test.php', $send_id);
     // 3rd param true forces clearing of any current uploads.
     if (true === $send_response) {
         $send_response = __('Success.', 'it-l10n-backupbuddy');
         $sendOK = true;
     } else {
         global $pb_backupbuddy_destination_errors;
         $send_response = 'Error sending test file to S3 (v2). Details: `' . implode(', ', $pb_backupbuddy_destination_errors) . '`.';
     }
     pb_backupbuddy::add_status_serial('remote_send-' . $send_id);
     // Delete sent file if it was sent.
     $delete_response = 'n/a';
     if (true === $sendOK) {
         pb_backupbuddy::status('details', 'Preparing to delete sent test file.');
         if ('1' == $settings['stash_mode']) {
             // Stash mode.
             if (true === ($delete_response = pb_backupbuddy_destination_stash2::deleteFile($settings, 'remote-send-test.php'))) {
                 // success
                 $delete_response = __('Success.', 'it-l10n-backupbuddy');
                 $deleteOK = true;
             } else {
                 // error
                 $error = 'Unable to delete Stash test file `remote-send-test.php`. Details: `' . $delete_response . '`.';
                 $delete_response = $error;
                 $deleteOK = false;
             }
         } else {
             // S3 mode.
             if (true === ($delete_response = self::deleteFile($settings, 'remote-send-test.php'))) {
                 $delete_response = __('Success.', 'it-l10n-backupbuddy');
                 $deleteOK = true;
             } else {
                 $error = 'Unable to delete test file `remote-send-test.php`. Details: `' . $delete_response . '`.';
                 pb_backupbuddy::status('details', $error);
                 $delete_response = $error;
                 $deleteOK = false;
             }
         }
     } else {
         // end if $sendOK.
         pb_backupbuddy::status('details', 'Skipping test delete due to failed send.');
     }
     // Load destination fileoptions.
     pb_backupbuddy::status('details', 'About to load fileoptions data.');
     require_once pb_backupbuddy::plugin_path() . '/classes/fileoptions.php';
     pb_backupbuddy::status('details', 'Fileoptions instance #7.');
     $fileoptions_obj = new pb_backupbuddy_fileoptions(backupbuddy_core::getLogDirectory() . 'fileoptions/send-' . $send_id . '.txt', $read_only = false, $ignore_lock = false, $create_file = false);
     if (true !== ($result = $fileoptions_obj->is_ok())) {
         return self::_error(__('Fatal Error #9034.84838. Unable to access fileoptions data.', 'it-l10n-backupbuddy') . ' Error: ' . $result);
     }
     pb_backupbuddy::status('details', 'Fileoptions data loaded.');
     $fileoptions =& $fileoptions_obj->options;
     if (true !== $sendOK || true !== $deleteOK) {
         $fileoptions['status'] = 'failure';
         $fileoptions_obj->save();
         unset($fileoptions_obj);
         return 'Send details: `' . $send_response . '`. Delete details: `' . $delete_response . '`.';
     } else {
         $fileoptions['status'] = 'success';
         $fileoptions['finish_time'] = time();
     }
     $fileoptions_obj->save();
     unset($fileoptions_obj);
     pb_backupbuddy::status('details', 'Finished test function.');
     return true;
 }
开发者ID:AgilData,项目名称:WordPress-Skeleton,代码行数:77,代码来源:init.php


示例18: array

    }
    if ('enable' == pb_backupbuddy::_GET('deploy')) {
        $identifier = pb_backupbuddy::random_string(12);
        $deployFile = backupbuddy_core::getTempDirectory() . 'deploy-' . backupbuddy_core::backup_prefix() . '.dat';
        // . '-' . $identifier .
        $meta = array('siteurl' => site_url(), 'deployEnabled' => time());
        $deployFileContents = json_encode($meta);
        pb_backupbuddy::anti_directory_browsing(backupbuddy_core::getTempDirectory(), $die = false);
        if (false === file_put_contents($deployFile, $deployFileContents)) {
            pb_backupbuddy::alert('Error #848383: Unable to write temporary deployment file `' . $deployFile . '`. Verify permissions on the directory.');
        } else {
            $destinationSettings = pb_backupbuddy::$options['remote_destinations'][$stashDestination];
            $destinationSettings['meta'] = $meta;
            $destinationSettings['forceRootUpload'] = true;
            require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
            $send_result = pb_backupbuddy_destinations::send($destinationSettings, array($deployFile), $identifier, $delete_after = true);
            if (true === $send_result) {
                pb_backupbuddy::$options['deployment_allowed'] = '1';
                pb_backupbuddy::save();
                pb_backupbuddy::alert(__('Deployments have been enabled for this site. Other sites sharing this Stash account may Push to or Pull from this site as long as your iThemes Member password is correctly provided.', 'it-l10n-backupbuddy'));
            } else {
                pb_backupbuddy::alert(__('Error #84838: Failure notifying Stash of new deployment site. See Remote Destinations page Recent Transfers listing for details.', 'it-l10n-backupbuddy'));
            }
        }
    } elseif ('disable' == pb_backupbuddy::_GET('deploy')) {
        pb_backupbuddy::$options['deployment_allowed'] = '0';
        pb_backupbuddy::save();
        pb_backupbuddy::alert(__('Deployments have been disabled for this site.', 'it-l10n-backupbuddy'));
    }
}
if (false !== $stashDestination) {
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:31,代码来源:_deployments.php


示例19: destination_send

 public function destination_send($destination_settings, $files)
 {
     // Pass off to destination handler.
     require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
     $send_result = pb_backupbuddy_destinations::send($destination_settings, $files);
     return $send_result;
 }
开发者ID:brettex,项目名称:pspark,代码行数:7,代码来源:core.php


示例20: process_queue

 public function process_queue()
 {
     // open queue file.
     $max_session_size = '50';
     // Size (MB) that is the max size sum of all files sent per instance. TODO: On timeout failure detect and scale back some to help with timeouts.
     $max_session_time = '30';
     // Currently only used to determine if we should auto-reduce the max session size if we are getting close to going over our time limit (help automatically avoid timeouts).
     $send_now_files = array();
     // Files that will be queued up to be sent this PHP instance.
     $send_now_size = 0;
     // Running sum of the size of all files queued up to be send this PHP instance.
     $need_save = false;
     // Whether or not we have updated something in the queue that needs saving.
     $unsent_files = false;
     foreach ($files as &$file) {
         // Loop through files in queue that need sent to Live.
         if ($send_now_size + $file['size'] <= $max_session_size) {
             // There is room to add this file.
             pb_backupbuddy::status('details', 'Added file `file.png` into queue.', 'live');
             if ($file['attempts'] >= 3) {
                 // send error email notifying that its not going to make it. give suggestions. chunking?
                 pb_backupbuddy::status('error', 'Large 94 MB file `file.png` has timed out X times and has is on hold pending user intervention.', 'live');
             } else {
                 $send_now_files .= $file;
                 $file['attempts']++;
                 $need_save = true;
             }
         } else {
             // There is not room for this file.
             if (count($send_now_files) == 0 && $file['size'] > $max_session_size) {
                 // If no files are queued in this send now list yet then we will try to send just this one big file on its own.
                 pb_backupbuddy::status('details', 'Large 94 MB file `file.png` exceeds max session size so it will be sent by itself to improve transfer success.', 'live');
                 $send_now_files .= $file;
                 $file['attempts']++;
                 $need_save = true;
                 $unsent_files = true;
                 break;
                 // We have maxed out the size with a single file so no need to keep going.
             }
             $unsent_files = true;
             break;
             // No more room for any other files if we made it here so stop looping.
         }
     }
     // end foreach.
     if ($need_save === true) {
         pb_backupbuddy::status('details', 'Saving queue file.', 'live');
         // Code to save the updated data structure to file.
         // After saving add this file itself to the send queue so it (the queue file) gets backed up soon?
     }
     // Call Stash to send these files.
     require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php';
     $send_result = pb_backupbuddy_destinations::send($destination_settings, $send_now_files);
     pb_backupbuddy::status('message', '4 MB file `file.png` Stashed in 12 seconds.', 'live');
     pb_backupbuddy::status('message', '4 MB file `file.png` did not complete after 60 seconds. Stashing it will be re-attempted in 30 seconds.', 'live');
     // remove all succesful transfers from the queue file and re-save it. be quick as we may be running out of time.
     //
     $this->kick_db();
     // Kick the database to make sure it didn't go away, preventing options saving.
     if ($unsent_files === true) {
         // schedule next queue_process() call.
     }
     // make note in data structure the last time the queue was processed & status (sent X mb in Y seconds. all files succeeded[4/5 files succeded])
 }
开发者ID:brettex,项目名称:pspark,代码行数:64,代码来源:live.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pb_backupbuddy_fileoptions类代码示例发布时间:2022-05-23
下一篇:
PHP pb_backupbuddy类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap