Beispiel #1
0
 /*---------------------------------------------------------------------
   Upgrade 1.9 to 1.10
   ---------------------------------------------------------------------*/
 if (preg_match('/^1.9/', $currentDbVersion)) {
     $function_list = array('upgrade_category_to_110', 'upgrade_session_course_to_110', 'upgrade_course_to_110', 'upgrade_cours_user_to_110', 'upgrade_coursehomepage_to_110', 'upgrade_event_resource_to_110');
     foreach ($function_list as $function) {
         $step = $function();
         if ($step > 0) {
             echo 'Error : ' . $function . ' at step . ' . $step . '<br />';
             $nbError++;
         }
     }
     if ($nbError == 0) {
         // Upgrade 1.9 to 1.10 Succeed
         echo '<p class="success">The claroline main tables have been successfully upgraded to version 1.10</p>' . "\n";
         clean_upgrade_status();
         // Database version is 1.10
         $currentDbVersion = '1.10';
         // Update current version file
         save_current_version_file($currentClarolineVersion, $currentDbVersion);
     }
 }
 // End of upgrade 1.9 to 1.10
 /*if ( preg_match('/^1.10/',$currentDbVersion) )
         {
             // Database version is 1.11
             $currentDbVersion = $new_version;
 
             // Update current version file
             save_current_version_file( $currentClarolineVersion, $currentDbVersion );
         }*/
Beispiel #2
0
         }
         $function_list[] = 'tool_intro_upgrade_to_110';
         $toolCLQWZ = get_module_data('CLQWZ');
         if (is_tool_activated_in_course($toolCLQWZ['id'], $currentCourseCode)) {
             $function_list[] = 'exercise_upgrade_to_110';
         }
         foreach ($function_list as $function) {
             $step = $function($currentCourseCode);
             if ($step > 0) {
                 echo 'Error : ' . $function . ' at step ' . $step . '<br />';
                 $error = true;
             }
         }
         if (!$error) {
             // Upgrade succeeded
             clean_upgrade_status($currentCourseCode);
             $currentCourseVersion = '1.10';
         } else {
             // Upgrade failed
             $currentCourseVersion = 'error-1.9';
         }
         // Save version
         save_course_current_version($currentCourseCode, $currentCourseVersion);
     }
 }
 if (!$error) {
     if (preg_match('/^1.10/', $currentCourseVersion)) {
         $message .= '<p>Ce cours est maintenant en version ' . $currentCourseVersion . ' </p>';
         // course upgraded
         $count_course_upgraded++;
     } else {