Exemplo n.º 1
0
/**
 * @var instance of User class
 */
global $current_User;
// Check minimum permission:
$current_User->check_perm('perm_maintenance', 'backup', true);
// Load Backup class (PHP4):
load_class('maintenance/model/_backup.class.php', 'Backup');
// Set options path:
$AdminUI->set_path('options', 'misc', 'backup');
// Get action parameter from request:
param_action('start');
// Create instance of Backup class
$current_Backup = new Backup();
// Load backup settings from request
if ($action == 'backup' && !$current_Backup->load_from_Request()) {
    $action = 'new';
}
$AdminUI->breadcrumbpath_init(false);
// fp> I'm playing with the idea of keeping the current blog in the path here...
$AdminUI->breadcrumbpath_add(T_('System'), $admin_url . '?ctrl=system');
$AdminUI->breadcrumbpath_add(T_('Maintenance'), $admin_url . '?ctrl=tools');
$AdminUI->breadcrumbpath_add(T_('Backup'), $admin_url . '?ctrl=backup');
// Set an url for manual page:
$AdminUI->set_page_manual_link('backup-tab');
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
$AdminUI->disp_payload_begin();
/**
Exemplo n.º 2
0
     $block_item_Widget->disp_template_replaced('block_start');
     $upgrade_name = param('upd_name', 'string', NULL, true);
     if ($upgrade_name === NULL) {
         // Get an upgrade name from url (Used for auto-upgrade, not svn)
         forget_param('upd_name');
         $download_url = param('upd_url', 'string', '', true);
         $upgrade_name = pathinfo($download_url);
         $upgrade_name = $upgrade_name['filename'];
     }
     $success = true;
 }
 // Load Backup class (PHP4) and backup all of the folders and files
 load_class('maintenance/model/_backup.class.php', 'Backup');
 $Backup = new Backup();
 // Memorize all form params in order t oresubmit form if some errors exist
 $Backup->load_from_Request(true);
 // Enable maintenance mode
 $success = $success && switch_maintenance_mode(true, 'upgrade', T_('System upgrade is in progress. Please reload this page in a few minutes.'));
 if ($success) {
     // Set maximum execution time
     set_max_execution_time(1800);
     // 30 minutes
     // Verify that all destination files can be overwritten
     echo '<h4>' . T_('Verifying that all destination files can be overwritten...') . '</h4>';
     evo_flush();
     $read_only_list = array();
     // Get a folder path where we should get the files
     $upgrade_folder_path = get_upgrade_folder_path($upgrade_name);
     $success = verify_overwrite($upgrade_folder_path, no_trailing_slash($basepath), 'Verifying', false, $read_only_list);
     if ($success && empty($read_only_list)) {
         // We can backup files and database