Пример #1
0
 // 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
     // Load Backup class (PHP4) and backup all of the folders and files
     load_class('maintenance/model/_backup.class.php', 'Backup');
     $Backup = new Backup();
     $Backup->include_all();
     if (!function_exists('gzopen')) {
         $Backup->pack_backup_files = false;
     }
     // Start backup
     if ($success = $Backup->start_backup()) {
         // We can upgrade files and database
         // Copying new folders and files
         echo '<h4>' . T_('Copying new folders and files...') . '</h4>';
         evo_flush();
         $success = verify_overwrite($upgrade_folder_path, no_trailing_slash($basepath), 'Copying', true, $read_only_list);
         if (!$success || !empty($read_only_list)) {
             // In case if something was changed before the previous verify_overwrite check
             echo '<p style="color:red"><strong>' . T_('The files and database backup was created successfully but all folders and files could not be overwritten');
             if (empty($read_only_list)) {
                 // There was some error in the verify_overwrite() function, but the corresponding error message was already displayed.