瀏覽代碼

Minor, cosmetic changes for the installation scripts.

Ivan Tcholakov 15 年之前
父節點
當前提交
91f2c0ab11

+ 22 - 37
main/install/index.php

@@ -1,25 +1,21 @@
-<?php //$id: $
+<?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* GOAL : Chamilo installation
-* As seen from the user, the installation proceeds in 6 steps.
-* The user is presented with several webpages where he/she has to make choices
-* and/or fill in data.
-*
-* The aim is, as always, to have good default settings and suggestions.
-*
-* @todo	reduce high level of duplication in this code
-* @todo (busy) organise code into functions
-* @package chamilo.install
-==============================================================================
-*/
-
-/*
-==============================================================================
-		CONSTANTS
-==============================================================================
-*/
+ * Chamilo installation
+ *
+ * As seen from the user, the installation proceeds in 6 steps.
+ * The user is presented with several webpages where he/she has to make choices
+ * and/or fill in data.
+ *
+ * The aim is, as always, to have good default settings and suggestions.
+ *
+ * @todo	reduce high level of duplication in this code
+ * @todo (busy) organise code into functions
+ * @package chamilo.install
+ */
+
+/*		CONSTANTS */
 
 define('SYSTEM_INSTALLATION', 1);
 define('INSTALL_TYPE_UPDATE', 'update');
@@ -27,11 +23,7 @@ define('FORM_FIELD_DISPLAY_LENGTH', 40);
 define('DATABASE_FORM_FIELD_DISPLAY_LENGTH', 25);
 define('MAX_FORM_FIELD_LENGTH', 80);
 
-/*
-==============================================================================
-		PHP VERSION CHECK
-==============================================================================
-*/
+/*		PHP VERSION CHECK */
 
 // PHP version requirement.
 define('REQUIRED_PHP_VERSION', '5');
@@ -43,11 +35,7 @@ if (!function_exists('version_compare') || version_compare( phpversion(), REQUIR
 	die();
 }
 
-/*
-==============================================================================
-		INITIALIZATION SECTION
-==============================================================================
-*/
+/*		INITIALIZATION SECTION */
 
 session_start();
 
@@ -144,13 +132,9 @@ if (is_already_installed_system()) {
 	die();
 }
 
-/*
-==============================================================================
-		STEP 1 : INITIALIZES FORM VARIABLES IF IT IS THE FIRST VISIT
-==============================================================================
-*/
+/*		STEP 1 : INITIALIZES FORM VARIABLES IF IT IS THE FIRST VISIT */
 
-//Is valid request
+// Is valid request
 $is_valid_request = $_REQUEST['is_executable'];
 foreach ($_POST as $request_index => $request_value) {
 	if (substr($request_index, 0, 4) == 'step') {
@@ -289,7 +273,8 @@ if (!isset($_GET['running'])) {
 	}
 }
 
-// The Steps
+/*		NEXT STEPS IMPLEMENTATION */
+
 $total_steps = 7;
 if (!$_POST) {
 	$current_step = 1;

+ 16 - 38
main/install/install.lib.php

@@ -2,32 +2,22 @@
 /* For licensing terms, see /license.txt */
 
 /**
-==============================================================================
-* Chamilo LMS
-* This file contains functions used by the install and upgrade scripts.
-*
-* Ideas for future additions:
-* - a function get_old_version_settings to retrieve the config file settings
-*   of older versions before upgrading.
-==============================================================================
-*/
-
-/*
-==============================================================================
-		CONSTANTS
-==============================================================================
-*/
+ * Chamilo LMS
+ * This file contains functions used by the install and upgrade scripts.
+ *
+ * Ideas for future additions:
+ * - a function get_old_version_settings to retrieve the config file settings
+ *   of older versions before upgrading.
+ */
+
+/*		CONSTANTS */
 
 define('SYSTEM_MAIN_DATABASE_FILE', 'db_main.sql');
 define('COUNTRY_DATA_FILENAME', 'country_data.csv');
 define('COURSES_HTACCESS_FILENAME', 'htaccess.dist');
 define('SYSTEM_CONFIG_FILENAME', 'configuration.dist.php');
 
-/*
-==============================================================================
-		COMMON PURPOSE FUNCTIONS
-==============================================================================
-*/
+/*		COMMON PURPOSE FUNCTIONS */
 
 /**
  * This function detects whether the system has been already installed.
@@ -217,11 +207,7 @@ function detect_browser_language() {
 	return 'english';
 }
 
-/*
-==============================================================================
-		FILESYSTEM RELATED FUNCTIONS
-==============================================================================
-*/
+/*		FILESYSTEM RELATED FUNCTIONS */
 
 /**
  * This function checks if the given folder is writable
@@ -441,7 +427,7 @@ function get_config_param($param, $updatePath = '') {
 			return null;
 		}
 	}
-	
+
 	if (file_exists($updatePath.$updateFromConfigFile)) {
 
 		// The parameter was not found among the global variables, so look into the old configuration file.
@@ -541,11 +527,11 @@ function get_config_param($param, $updatePath = '') {
 		$dokeos_version = $val;
 
 		if (empty($dokeos_version)) {
-			//checking the dokeos_version value exists in main/inc/installedVersion.inc.php 
+			//checking the dokeos_version value exists in main/inc/installedVersion.inc.php
 			if (file_exists($updatePath.'main/inc/installedVersion.inc.php')) {
 				$updateFromInstalledVersionFile = $updatePath.'main/inc/installedVersion.inc.php';
 				require ($updateFromInstalledVersionFile); //there are only 2 variables here: $stable & $dokeos_version
-				$stable = false;		
+				$stable = false;
 			}
 		}
 		return $dokeos_version;
@@ -559,11 +545,7 @@ function get_config_param($param, $updatePath = '') {
 	}
 }
 
-/*
-==============================================================================
-		DATABASE RELATED FUNCTIONS
-==============================================================================
-*/
+/*		DATABASE RELATED FUNCTIONS */
 
 /**
  * Gets a configuration parameter from the database. Returns returns null on failure.
@@ -918,11 +900,7 @@ function add_document_180($_course, $path, $filetype, $filesize, $title, $commen
     }
 }
 
-/*
-==============================================================================
-		DISPLAY FUNCTIONS
-==============================================================================
-*/
+/*		DISPLAY FUNCTIONS */
 
 /**
  * This function prints class=active_step $current_step=$param

+ 10 - 17
main/install/install_db.inc.php

@@ -1,19 +1,12 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-*	Install the Chamilo database
-*	Notice : This script has to be included by index.php
-*
-*	@package chamilo.install
-==============================================================================
-*/
-
-/*
-==============================================================================
-		MAIN CODE
-==============================================================================
-*/
+ *	Install the Chamilo database
+ *	Notice : This script has to be included by index.php
+ *
+ *	@package chamilo.install
+ */
 
 // This page can only be access through including from the install script.
 
@@ -120,7 +113,7 @@ if(!defined('CLI_INSTALLATION')) {
 }
 
 /**
- * creating the tables of the main database
+ * Creating the tables of the main database
  */
 Database::select_db($mysqlMainDb) or die(Database::error());
 
@@ -142,7 +135,7 @@ $installation_settings['{HASHFUNCTIONMODE}'] = $encryptPassForm;
 load_main_database($installation_settings);
 
 /**
- * creating the tables of the tracking database
+ * Creating the tables of the tracking database
  */
 
 Database::select_db($mysqlStatsDb) or die(Database::error());
@@ -153,8 +146,8 @@ $track_countries_table = "track_c_countries";
 fill_track_countries_table($track_countries_table);
 
 /**
- * creating the tables of the USER database
- * this is where the personal agenda items are storen, the user defined course categories (sorting of my courses)
+ * Creating the tables of the USER database
+ * This is where the personal agenda items are storen, the user defined course categories (sorting of my courses)
  */
 
 Database::select_db($mysqlUserDb) or die(Database::error());

+ 13 - 14
main/install/install_files.inc.php

@@ -1,19 +1,18 @@
-<?php // $Id: install_files.inc.php 22577 2009-08-03 04:31:24Z yannoo $
+<?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Install the Chamilo files
-* Notice : This script has to be included by install/index.php
-*
-* The script creates two files:
-* - configuration.php, the file that contains very important info for Chamilo
-*   such as the database names.
-* - .htaccess file (in the courses directory) that is optional but improves
-*   security
-*
-* @package chamilo.install
-==============================================================================
-*/
+ * Install the Chamilo files
+ * Notice : This script has to be included by install/index.php
+ *
+ * The script creates two files:
+ * - configuration.php, the file that contains very important info for Chamilo
+ *   such as the database names.
+ * - .htaccess file (in the courses directory) that is optional but improves
+ *   security
+ *
+ * @package chamilo.install
+ */
 
 if (defined('SYSTEM_INSTALLATION')) {
 

+ 17 - 28
main/install/update-db-1.6.x-1.8.0.inc.php

@@ -1,28 +1,21 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Update the Chamilo database from an older Dokeos version
-* Notice : This script has to be included by index.php
-* or update_courses.php (deprecated).
-*
-* @package chamilo.install
-* @todo
-* - conditional changing of tables. Currently we execute for example
-* ALTER TABLE `$dbNameForm`.`cours`
-* instructions without checking wether this is necessary.
-* - reorganise code into functions
-* @todo use database library
-==============================================================================
-*/
-
-/*
-==============================================================================
-		MAIN CODE
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Update the Chamilo database from an older Dokeos version
+ * Notice : This script has to be included by index.php
+ * or update_courses.php (deprecated).
+ *
+ * @package chamilo.install
+ * @todo
+ * - conditional changing of tables. Currently we execute for example
+ * ALTER TABLE `$dbNameForm`.`cours`
+ * instructions without checking wether this is necessary.
+ * - reorganise code into functions
+ * @todo use database library
+ */
 
 // Check if we come from index.php or update_courses.php - otherwise display error msg
 if (defined('SYSTEM_INSTALLATION')) {
@@ -55,12 +48,8 @@ if (defined('SYSTEM_INSTALLATION')) {
 		$dbScormForm = $dbPrefixForm.'scorm';
 	}
 
-	/*
-	-----------------------------------------------------------
-		Normal upgrade procedure:
-		start by updating main, statistic, user databases
-	-----------------------------------------------------------
-	*/
+	/*	Normal upgrade procedure: start by updating main, statistic, user databases */
+
 	// If this script has been included by index.php, not update_courses.php, so
 	// that we want to change the main databases as well...
 	$only_test = false;

+ 17 - 28
main/install/update-db-1.8.0-1.8.2.inc.php

@@ -1,28 +1,21 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Update the Chamilo database from an older Dokeos version
-* Notice : This script has to be included by index.php
-* or update_courses.php (deprecated).
-*
-* @package chamilo.install
-* @todo
-* - conditional changing of tables. Currently we execute for example
-* ALTER TABLE `$dbNameForm`.`cours`
-* instructions without checking wether this is necessary.
-* - reorganise code into functions
-* @todo use database library
-==============================================================================
-*/
-
-/*
-==============================================================================
-		MAIN CODE
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Update the Chamilo database from an older Dokeos version
+ * Notice : This script has to be included by index.php
+ * or update_courses.php (deprecated).
+ *
+ * @package chamilo.install
+ * @todo
+ * - conditional changing of tables. Currently we execute for example
+ * ALTER TABLE `$dbNameForm`.`cours`
+ * instructions without checking wether this is necessary.
+ * - reorganise code into functions
+ * @todo use database library
+ */
 
 // Check if we come from index.php or update_courses.php - otherwise display error msg
 if (defined('SYSTEM_INSTALLATION')) {
@@ -54,12 +47,8 @@ if (defined('SYSTEM_INSTALLATION')) {
 		$dbScormForm = $dbPrefixForm.'scorm';
 	}
 
-	/*
-	-----------------------------------------------------------
-		Normal upgrade procedure:
-		start by updating main, statistic, user databases
-	-----------------------------------------------------------
-	*/
+	/*	Normal upgrade procedure: start by updating main, statistic, user databases */
+
 	// If this script has been included by index.php, not update_courses.php, so
 	// that we want to change the main databases as well...
 	$only_test = false;

+ 17 - 28
main/install/update-db-1.8.2-1.8.3.inc.php

@@ -1,28 +1,21 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Update the Chamilo database from an older Dokeos version
-* Notice : This script has to be included by index.php
-* or update_courses.php (deprecated).
-*
-* @package chamilo.install
-* @todo
-* - conditional changing of tables. Currently we execute for example
-* ALTER TABLE `$dbNameForm`.`cours`
-* instructions without checking wether this is necessary.
-* - reorganise code into functions
-* @todo use database library
-==============================================================================
-*/
-
-/*
-==============================================================================
-		MAIN CODE
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Update the Chamilo database from an older Dokeos version
+ * Notice : This script has to be included by index.php
+ * or update_courses.php (deprecated).
+ *
+ * @package chamilo.install
+ * @todo
+ * - conditional changing of tables. Currently we execute for example
+ * ALTER TABLE `$dbNameForm`.`cours`
+ * instructions without checking wether this is necessary.
+ * - reorganise code into functions
+ * @todo use database library
+ */
 
 // Check if we come from index.php or update_courses.php - otherwise display error msg
 if (defined('SYSTEM_INSTALLATION')) {
@@ -54,12 +47,8 @@ if (defined('SYSTEM_INSTALLATION')) {
 		$dbScormForm = $dbPrefixForm.'scorm';
 	}
 
-	/*
-	-----------------------------------------------------------
-		Normal upgrade procedure:
-		start by updating main, statistic, user databases
-	-----------------------------------------------------------
-	*/
+	/*	Normal upgrade procedure: start by updating main, statistic, user databases */
+
 	// If this script has been included by index.php, not update_courses.php, so
 	// that we want to change the main databases as well...
 	$only_test = false;

+ 17 - 28
main/install/update-db-1.8.3-1.8.4.inc.php

@@ -1,28 +1,21 @@
 <?php
 /* For licensing terms, see /license.txt */
-/**
-==============================================================================
-* Chamilo LMS
-*
-* Update the Chamilo database from an older Dokeos version
-* Notice : This script has to be included by index.php
-* or update_courses.php (deprecated).
-*
-* @package chamilo.install
-* @todo
-* - conditional changing of tables. Currently we execute for example
-* ALTER TABLE `$dbNameForm`.`cours`
-* instructions without checking wether this is necessary.
-* - reorganise code into functions
-* @todo use database library
-==============================================================================
-*/
 
-/*
-==============================================================================
-		MAIN CODE
-==============================================================================
-*/
+/**
+ * Chamilo LMS
+ *
+ * Update the Chamilo database from an older Dokeos version
+ * Notice : This script has to be included by index.php
+ * or update_courses.php (deprecated).
+ *
+ * @package chamilo.install
+ * @todo
+ * - conditional changing of tables. Currently we execute for example
+ * ALTER TABLE `$dbNameForm`.`cours`
+ * instructions without checking wether this is necessary.
+ * - reorganise code into functions
+ * @todo use database library
+ */
 
 // Check if we come from index.php or update_courses.php - otherwise display error msg
 if (defined('SYSTEM_INSTALLATION')) {
@@ -54,12 +47,8 @@ if (defined('SYSTEM_INSTALLATION')) {
 		$dbScormForm = $dbPrefixForm.'scorm';
 	}
 
-	/*
-	-----------------------------------------------------------
-		Normal upgrade procedure:
-		start by updating main, statistic, user databases
-	-----------------------------------------------------------
-	*/
+	/*	Normal upgrade procedure: start by updating main, statistic, user databases */
+
 	// If this script has been included by index.php, not update_courses.php, so
 	// that we want to change the main databases as well...
 	$only_test = false;

+ 17 - 28
main/install/update-db-1.8.4-1.8.5.inc.php

@@ -1,32 +1,25 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Update the Chamilo database from an older Dokeos version
-* Notice : This script has to be included by index.php
-* or update_courses.php (deprecated).
-*
-* @package chamilo.install
-* @todo
-* - conditional changing of tables. Currently we execute for example
-* ALTER TABLE `$dbNameForm`.`cours`
-* instructions without checking wether this is necessary.
-* - reorganise code into functions
-* @todo use database library
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Update the Chamilo database from an older Dokeos version
+ * Notice : This script has to be included by index.php
+ * or update_courses.php (deprecated).
+ *
+ * @package chamilo.install
+ * @todo
+ * - conditional changing of tables. Currently we execute for example
+ * ALTER TABLE `$dbNameForm`.`cours`
+ * instructions without checking wether this is necessary.
+ * - reorganise code into functions
+ * @todo use database library
+ */
 
 $old_file_version = '1.8.4';
 $new_file_version = '1.8.5';
 
-/*
-==============================================================================
-		MAIN CODE
-==============================================================================
-*/
-
 // Check if we come from index.php or update_courses.php - otherwise display error msg
 if (defined('SYSTEM_INSTALLATION')) {
 
@@ -57,12 +50,8 @@ if (defined('SYSTEM_INSTALLATION')) {
 		$dbScormForm = $dbPrefixForm.'scorm';
 	}
 
-	/*
-	-----------------------------------------------------------
-		Normal upgrade procedure:
-		start by updating main, statistic, user databases
-	-----------------------------------------------------------
-	*/
+	/*	Normal upgrade procedure: start by updating main, statistic, user databases */
+
 	// If this script has been included by index.php, not update_courses.php, so
 	// that we want to change the main databases as well...
 	$only_test = false;

+ 17 - 28
main/install/update-db-1.8.5-1.8.6.inc.php

@@ -1,32 +1,25 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Update the Chamilo database from an older Dokeos version
-* Notice : This script has to be included by index.php
-* or update_courses.php (deprecated).
-*
-* @package chamilo.install
-* @todo
-* - conditional changing of tables. Currently we execute for example
-* ALTER TABLE `$dbNameForm`.`cours`
-* instructions without checking wether this is necessary.
-* - reorganise code into functions
-* @todo use database library
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Update the Chamilo database from an older Dokeos version
+ * Notice : This script has to be included by index.php
+ * or update_courses.php (deprecated).
+ *
+ * @package chamilo.install
+ * @todo
+ * - conditional changing of tables. Currently we execute for example
+ * ALTER TABLE `$dbNameForm`.`cours`
+ * instructions without checking wether this is necessary.
+ * - reorganise code into functions
+ * @todo use database library
+ */
 
 $old_file_version = '1.8.5';
 $new_file_version = '1.8.6';
 
-/*
-==============================================================================
-		MAIN CODE
-==============================================================================
-*/
-
 // Check if we come from index.php or update_courses.php - otherwise display error msg
 if (defined('SYSTEM_INSTALLATION')) {
 
@@ -57,12 +50,8 @@ if (defined('SYSTEM_INSTALLATION')) {
 		$dbScormForm = $dbPrefixForm.'scorm';
 	}
 
-	/*
-	-----------------------------------------------------------
-		Normal upgrade procedure:
-		start by updating main, statistic, user databases
-	-----------------------------------------------------------
-	*/
+	/*	Normal upgrade procedure: start by updating main, statistic, user databases */
+
 	// If this script has been included by index.php, not update_courses.php, so
 	// that we want to change the main databases as well...
 	$only_test = false;

+ 17 - 28
main/install/update-db-1.8.6-1.8.6.1.inc.php

@@ -1,32 +1,25 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Update the Chamilo database from an older Dokeos version
-* Notice : This script has to be included by index.php
-* or update_courses.php (deprecated).
-*
-* @package chamilo.install
-* @todo
-* - conditional changing of tables. Currently we execute for example
-* ALTER TABLE `$dbNameForm`.`cours`
-* instructions without checking wether this is necessary.
-* - reorganise code into functions
-* @todo use database library
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Update the Chamilo database from an older Dokeos version
+ * Notice : This script has to be included by index.php
+ * or update_courses.php (deprecated).
+ *
+ * @package chamilo.install
+ * @todo
+ * - conditional changing of tables. Currently we execute for example
+ * ALTER TABLE `$dbNameForm`.`cours`
+ * instructions without checking wether this is necessary.
+ * - reorganise code into functions
+ * @todo use database library
+ */
 
 $old_file_version = '1.8.6';
 $new_file_version = '1.8.6.1';
 
-/*
-==============================================================================
-		MAIN CODE
-==============================================================================
-*/
-
 //check if we come from index.php or update_courses.php - otherwise display error msg
 if (defined('SYSTEM_INSTALLATION')) {
 
@@ -57,12 +50,8 @@ if (defined('SYSTEM_INSTALLATION')) {
 		$dbScormForm = $dbPrefixForm.'scorm';
 	}
 
-	/*
-	-----------------------------------------------------------
-		Normal upgrade procedure:
-		start by updating main, statistic, user databases
-	-----------------------------------------------------------
-	*/
+	/*	Normal upgrade procedure: start by updating main, statistic, user databases */
+
 	// If this script has been included by index.php, not update_courses.php, so
 	// that we want to change the main databases as well...
 	$only_test = false;

+ 17 - 28
main/install/update-db-1.8.6.1-1.8.6.2.inc.php

@@ -1,32 +1,25 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Update the Chamilo database from an older Dokeos version
-* Notice : This script has to be included by index.php
-* or update_courses.php (deprecated).
-*
-* @package chamilo.install
-* @todo
-* - conditional changing of tables. Currently we execute for example
-* ALTER TABLE `$dbNameForm`.`cours`
-* instructions without checking wether this is necessary.
-* - reorganise code into functions
-* @todo use database library
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Update the Chamilo database from an older Dokeos version
+ * Notice : This script has to be included by index.php
+ * or update_courses.php (deprecated).
+ *
+ * @package chamilo.install
+ * @todo
+ * - conditional changing of tables. Currently we execute for example
+ * ALTER TABLE `$dbNameForm`.`cours`
+ * instructions without checking wether this is necessary.
+ * - reorganise code into functions
+ * @todo use database library
+ */
 
 $old_file_version = '1.8.6.1';
 $new_file_version = '1.8.6.2';
 
-/*
-==============================================================================
-		MAIN CODE
-==============================================================================
-*/
-
 // Check if we come from index.php or update_courses.php - otherwise display error msg
 if (defined('SYSTEM_INSTALLATION')) {
 
@@ -57,12 +50,8 @@ if (defined('SYSTEM_INSTALLATION')) {
 		$dbScormForm = $dbPrefixForm.'scorm';
 	}
 
-	/*
-	-----------------------------------------------------------
-		Normal upgrade procedure:
-		start by updating main, statistic, user databases
-	-----------------------------------------------------------
-	*/
+	/*	Normal upgrade procedure: start by updating main, statistic, user databases */
+
 	// If this script has been included by index.php, not update_courses.php, so
 	// that we want to change the main databases as well...
 	$only_test = false;

+ 17 - 28
main/install/update-db-1.8.6.2-1.8.7.inc.php

@@ -1,32 +1,25 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Update the Chamilo database from an older Dokeos version
-* Notice : This script has to be included by index.php
-* or update_courses.php (deprecated).
-*
-* @package chamilo.install
-* @todo
-* - conditional changing of tables. Currently we execute for example
-* ALTER TABLE `$dbNameForm`.`cours`
-* instructions without checking wether this is necessary.
-* - reorganise code into functions
-* @todo use database library
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Update the Chamilo database from an older Dokeos version
+ * Notice : This script has to be included by index.php
+ * or update_courses.php (deprecated).
+ *
+ * @package chamilo.install
+ * @todo
+ * - conditional changing of tables. Currently we execute for example
+ * ALTER TABLE `$dbNameForm`.`cours`
+ * instructions without checking wether this is necessary.
+ * - reorganise code into functions
+ * @todo use database library
+ */
 
 $old_file_version = '1.8.6.2';
 $new_file_version = '1.8.7';
 
-/*
-==============================================================================
-        MAIN CODE
-==============================================================================
-*/
-
 // Check if we come from index.php or update_courses.php - otherwise display error msg
 if (defined('SYSTEM_INSTALLATION')) {
 
@@ -57,12 +50,8 @@ if (defined('SYSTEM_INSTALLATION')) {
         $dbScormForm = $dbPrefixForm.'scorm';
     }
 
-    /*
-    -----------------------------------------------------------
-        Normal upgrade procedure:
-        start by updating main, statistic, user databases
-    -----------------------------------------------------------
-    */
+    /*   Normal upgrade procedure: start by updating main, statistic, user databases */
+
     // If this script has been included by index.php, not update_courses.php, so
     // that we want to change the main databases as well...
     $only_test = false;

+ 2 - 1
main/install/update-db-scorm-1.6.x-1.8.0.inc.php

@@ -1,5 +1,6 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
  * Chamilo LMS
  * Script handling the migration between an old Dokeos platform (<1.8.0) to
@@ -35,7 +36,7 @@ function my_get_time($time) {
     else return 0;
 }
 
-//open log file
+// Open log file
 $fh = fopen('../../archive/newscorm_'.time().'.log', 'w');
 $fh_revert = fopen('../../archive/newscorm_'.time().'_revert.log', 'w');
 $fh_res = fopen('../../archive/newscorm_'.time().'_res.log', 'w');

+ 17 - 29
main/install/update-files-1.6.x-1.8.0.inc.php

@@ -1,29 +1,23 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Updates the Dokeos files from version 1.6.x to version 1.8.0
-* IMPORTANT: This script has to be included by install/index.php or
-* update_courses.php (deprecated)
-*
-* SYSTEM_INSTALLATION is defined in the install/index.php (means that we are in
-* the regular upgrade process)
-*
-* When SYSTEM_INSTALLATION is defined, do for every course:
-* - create a new set of directories that reflect the new tools offered by 1.8
-* - record an item_property for each directory added
-*
-* @package chamilo.install
-==============================================================================
-*/
-
-/*
-==============================================================================
-		FUNCTIONS
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Updates the Dokeos files from version 1.6.x to version 1.8.0
+ * IMPORTANT: This script has to be included by install/index.php or
+ * update_courses.php (deprecated)
+ *
+ * SYSTEM_INSTALLATION is defined in the install/index.php (means that we are in
+ * the regular upgrade process)
+ *
+ * When SYSTEM_INSTALLATION is defined, do for every course:
+ * - create a new set of directories that reflect the new tools offered by 1.8
+ * - record an item_property for each directory added
+ *
+ * @package chamilo.install
+ */
+
 function insert_db($db_name, $folder_name, $text) {
 
 	// TODO: The (global?) variable $_course has not been declared/initialized.
@@ -34,12 +28,6 @@ function insert_db($db_name, $folder_name, $text) {
 
 }
 
-/*
-==============================================================================
-		INIT SECTION
-==============================================================================
-*/
-
 if (defined('SYSTEM_INSTALLATION')) {
 
 	$sys_course_path = $pathForm.'courses/';

+ 15 - 16
main/install/update-files-1.8.3-1.8.4.inc.php

@@ -1,22 +1,21 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Updates the Dokeos files from version 1.8.3 to version 1.8.4
-* This script operates only in the case of an update, and only to change the
-* active version number (and other things that might need a change) in the
-* current configuration file.
-* As of 1.8.4, the Dokeos version has been added to configuration.php to
-* allow for edition (inc/conf is one of the directories that needs write
-* permissions on upgrade).
-* Being in configuration.php, it benefits from the configuration.dist.php
-* advantages that a new version doesn't overwrite it, thus letting the old
-* version be available until the end of the installation.
-* @package chamilo.install
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Updates the Dokeos files from version 1.8.3 to version 1.8.4
+ * This script operates only in the case of an update, and only to change the
+ * active version number (and other things that might need a change) in the
+ * current configuration file.
+ * As of 1.8.4, the Dokeos version has been added to configuration.php to
+ * allow for edition (inc/conf is one of the directories that needs write
+ * permissions on upgrade).
+ * Being in configuration.php, it benefits from the configuration.dist.php
+ * advantages that a new version doesn't overwrite it, thus letting the old
+ * version be available until the end of the installation.
+ * @package chamilo.install
+ */
 
 if (defined('SYSTEM_INSTALLATION')) {
 

+ 15 - 16
main/install/update-files-1.8.4-1.8.5.inc.php

@@ -1,22 +1,21 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Updates the Dokeos files from version 1.8.4 to version 1.8.5
-* This script operates only in the case of an update, and only to change the
-* active version number (and other things that might need a change) in the
-* current configuration file.
-* As of 1.8.5, the Dokeos version has been added to configuration.php to
-* allow for edition (inc/conf is one of the directories that needs write
-* permissions on upgrade).
-* Being in configuration.php, it benefits from the configuration.dist.php
-* advantages that a new version doesn't overwrite it, thus letting the old
-* version be available until the end of the installation.
-* @package chamilo.install
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Updates the Dokeos files from version 1.8.4 to version 1.8.5
+ * This script operates only in the case of an update, and only to change the
+ * active version number (and other things that might need a change) in the
+ * current configuration file.
+ * As of 1.8.5, the Dokeos version has been added to configuration.php to
+ * allow for edition (inc/conf is one of the directories that needs write
+ * permissions on upgrade).
+ * Being in configuration.php, it benefits from the configuration.dist.php
+ * advantages that a new version doesn't overwrite it, thus letting the old
+ * version be available until the end of the installation.
+ * @package chamilo.install
+ */
 
 if (defined('SYSTEM_INSTALLATION')) {
 

+ 15 - 16
main/install/update-files-1.8.5-1.8.6.inc.php

@@ -1,22 +1,21 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Updates the Dokeos files from version 1.8.5 to version 1.8.6
-* This script operates only in the case of an update, and only to change the
-* active version number (and other things that might need a change) in the
-* current configuration file.
-* As of 1.8.6, the Dokeos version has been added to configuration.php to
-* allow for edition (inc/conf is one of the directories that needs write
-* permissions on upgrade).
-* Being in configuration.php, it benefits from the configuration.dist.php
-* advantages that a new version doesn't overwrite it, thus letting the old
-* version be available until the end of the installation.
-* @package chamilo.install
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Updates the Dokeos files from version 1.8.5 to version 1.8.6
+ * This script operates only in the case of an update, and only to change the
+ * active version number (and other things that might need a change) in the
+ * current configuration file.
+ * As of 1.8.6, the Dokeos version has been added to configuration.php to
+ * allow for edition (inc/conf is one of the directories that needs write
+ * permissions on upgrade).
+ * Being in configuration.php, it benefits from the configuration.dist.php
+ * advantages that a new version doesn't overwrite it, thus letting the old
+ * version be available until the end of the installation.
+ * @package chamilo.install
+ */
 
 if (defined('SYSTEM_INSTALLATION')) {
 

+ 15 - 16
main/install/update-files-1.8.6-1.8.6.1.inc.php

@@ -1,22 +1,21 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Updates the Dokeos files from version 1.8.6 to version 1.8.6.1
-* This script operates only in the case of an update, and only to change the
-* active version number (and other things that might need a change) in the
-* current configuration file.
-* As of 1.8.6, the Dokeos version has been added to configuration.php to
-* allow for edition (inc/conf is one of the directories that needs write
-* permissions on upgrade).
-* Being in configuration.php, it benefits from the configuration.dist.php
-* advantages that a new version doesn't overwrite it, thus letting the old
-* version be available until the end of the installation.
-* @package chamilo.install
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Updates the Dokeos files from version 1.8.6 to version 1.8.6.1
+ * This script operates only in the case of an update, and only to change the
+ * active version number (and other things that might need a change) in the
+ * current configuration file.
+ * As of 1.8.6, the Dokeos version has been added to configuration.php to
+ * allow for edition (inc/conf is one of the directories that needs write
+ * permissions on upgrade).
+ * Being in configuration.php, it benefits from the configuration.dist.php
+ * advantages that a new version doesn't overwrite it, thus letting the old
+ * version be available until the end of the installation.
+ * @package chamilo.install
+ */
 
 if (defined('SYSTEM_INSTALLATION')) {
 

+ 9 - 10
main/install/update-files-1.8.6.1-1.8.6.2.inc.php

@@ -1,16 +1,15 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Updates the Dokeos files from version 1.8.6.1 to Chamilo version 1.8.6.2
-* This script operates only in the case of an update, and only to change the
-* active version number (and other things that might need a change) in the
-* current configuration file.
-* @package chamilo.install
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Updates the Dokeos files from version 1.8.6.1 to Chamilo version 1.8.6.2
+ * This script operates only in the case of an update, and only to change the
+ * active version number (and other things that might need a change) in the
+ * current configuration file.
+ * @package chamilo.install
+ */
 
 if (defined('SYSTEM_INSTALLATION')) {
 

+ 9 - 10
main/install/update-files-1.8.6.2-1.8.7.inc.php

@@ -1,16 +1,15 @@
 <?php
 /* For licensing terms, see /license.txt */
+
 /**
-==============================================================================
-* Chamilo LMS
-*
-* Updates the Chamilo files from version 1.8.6.2 to version 1.8.7
-* This script operates only in the case of an update, and only to change the
-* active version number (and other things that might need a change) in the
-* current configuration file.
-* @package chamilo.install
-==============================================================================
-*/
+ * Chamilo LMS
+ *
+ * Updates the Chamilo files from version 1.8.6.2 to version 1.8.7
+ * This script operates only in the case of an update, and only to change the
+ * active version number (and other things that might need a change) in the
+ * current configuration file.
+ * @package chamilo.install
+ */
 
 if (defined('SYSTEM_INSTALLATION')) {