当前位置: 首页>>代码示例>>PHP>>正文


PHP backupbuddy_core::preflight_check方法代码示例

本文整理汇总了PHP中backupbuddy_core::preflight_check方法的典型用法代码示例。如果您正苦于以下问题:PHP backupbuddy_core::preflight_check方法的具体用法?PHP backupbuddy_core::preflight_check怎么用?PHP backupbuddy_core::preflight_check使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在backupbuddy_core的用法示例。


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

示例1: process_scheduled_backup

 function process_scheduled_backup($cron_id)
 {
     if (!class_exists('backupbuddy_core')) {
         require_once pb_backupbuddy::plugin_path() . '/classes/core.php';
     }
     if (!isset(pb_backupbuddy::$options)) {
         $this->load();
     }
     // Verify directories.
     backupbuddy_core::verify_directories($skipTempGeneration = true);
     pb_backupbuddy::status('details', 'cron_process_scheduled_backup: ' . $cron_id);
     $preflight_message = '';
     $preflight_checks = backupbuddy_core::preflight_check();
     foreach ($preflight_checks as $preflight_check) {
         if ($preflight_check['success'] !== true) {
             pb_backupbuddy::status('warning', $preflight_check['message']);
         }
     }
     if (isset(pb_backupbuddy::$options['schedules'][$cron_id]) && is_array(pb_backupbuddy::$options['schedules'][$cron_id])) {
         // If schedule is disabled then just return. Bail out!
         if (isset(pb_backupbuddy::$options['schedules'][$cron_id]['on_off']) && pb_backupbuddy::$options['schedules'][$cron_id]['on_off'] == '0') {
             pb_backupbuddy::status('message', 'Schedule `' . $cron_id . '` NOT run due to being disabled based on this schedule\'s settings.');
             return;
         }
         pb_backupbuddy::$options['schedules'][$cron_id]['last_run'] = time();
         // update last run time.
         pb_backupbuddy::save();
         if (!isset(pb_backupbuddy::$classes['backup'])) {
             require_once pb_backupbuddy::plugin_path() . '/classes/backup.php';
             pb_backupbuddy::$classes['backup'] = new pb_backupbuddy_backup();
         }
         if (pb_backupbuddy::$options['schedules'][$cron_id]['delete_after'] == '1') {
             $delete_after = true;
             pb_backupbuddy::status('details', 'Option to delete file after successful transfer enabled.');
         } else {
             $delete_after = false;
             pb_backupbuddy::status('details', 'Option to delete file after successful transfer disabled.');
         }
         // If any remote destinations are set then add these to the steps to perform after the backup.
         $post_backup_steps = array();
         $destinations = explode('|', pb_backupbuddy::$options['schedules'][$cron_id]['remote_destinations']);
         $found_valid_destination = false;
         // Remove any invalid destinations from this run.
         foreach ($destinations as $destination_index => $destination) {
             if (!isset($destination) || $destination == '') {
                 // Remove.
                 unset($destinations[$destination_index]);
             }
             if (!isset(pb_backupbuddy::$options['remote_destinations'][$destination])) {
                 // Destination ID is invalid; remove.
                 unset($destinations[$destination_index]);
             }
         }
         $destination_count = count($destinations);
         $i = 0;
         foreach ($destinations as $destination) {
             $i++;
             if ($i >= $destination_count) {
                 // Last destination. Delete after if enabled.
                 $this_delete_after = $delete_after;
                 pb_backupbuddy::status('details', 'Last destination set to send to so this file deletion will be determined by settings.');
             } else {
                 // More destinations to send to. Only delete after final send.
                 $this_delete_after = false;
                 pb_backupbuddy::status('details', 'More destinations are set to send to so this file will not be deleted after send.');
             }
             $args = array($destination, $this_delete_after);
             pb_backupbuddy::status('details', 'Adding send step with args `' . implode(',', $args) . '`.');
             array_push($post_backup_steps, array('function' => 'send_remote_destination', 'args' => $args, 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0));
             $found_valid_destination = true;
             pb_backupbuddy::status('details', 'Found valid destination.');
         }
         $profile_array = pb_backupbuddy::$options['profiles'][pb_backupbuddy::$options['schedules'][$cron_id]['profile']];
         if (pb_backupbuddy::$classes['backup']->start_backup_process($profile_array, 'scheduled', array(), $post_backup_steps, pb_backupbuddy::$options['schedules'][$cron_id]['title']) !== true) {
             pb_backupbuddy::status('error', 'Error #4564658344443: Backup failure. See earlier logging details for more information.');
         }
     }
     pb_backupbuddy::status('details', 'Finished cron_process_scheduled_backup.');
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:79,代码来源:actions.php

示例2: jQuery

	<li data-class="profile_choose">Click a backup type to start a backup now...</li>
	<li data-id="pb_backupbuddy_afterbackupremote">Select to send a backup to a remote destination after the manual backup completes. After selecting this option select a profile above to start a backup.</li>
	<li data-class="nav-tab-0">Backups stored on this server are listed here... Hover over backups listed for additional options such as sending to another server or restoring files.</li>
	<li data-class="nav-tab-1" data-button="Finish">This provides a historical listing of recently created backups and the status of each.</li>
</ol>
<script>
jQuery(window).load(function() {
	jQuery(document).on( 'click', '.pb_backupbuddy_begintour', function(e) {
		jQuery("#pb_backupbuddy_tour").joyride({
			tipLocation: 'top',
		});
		return false;
	});
});
</script>
<?php 
// END TOUR.
backupbuddy_core::versions_confirm();
$alert_message = array();
$preflight_checks = backupbuddy_core::preflight_check();
foreach ($preflight_checks as $preflight_check) {
    if ($preflight_check['success'] !== true) {
        //$alert_message[] = $preflight_check['message'];
        pb_backupbuddy::disalert($preflight_check['test'], $preflight_check['message']);
    }
}
if (count($alert_message) > 0) {
    //pb_backupbuddy::alert( implode( '<hr style="border: 1px dashed #E6DB55; border-bottom: 0;">', $alert_message ) );
}
$view_data['backups'] = backupbuddy_core::backups_list('default');
pb_backupbuddy::load_view('_backup-home', $view_data);
开发者ID:FelixNong1990,项目名称:andy,代码行数:31,代码来源:_backup-home.php


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