diff --git a/main/install/_INSTALL.txt b/main/install/_INSTALL.txt
deleted file mode 100644
index 4ef984d27d..0000000000
--- a/main/install/_INSTALL.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-For installation help, see installation_guide.html or INSTALL.txt at the Chamilo root directory
-(which should be two directories up from this)
\ No newline at end of file
diff --git a/main/install/_compare_db.php b/main/install/_compare_db.php
deleted file mode 100644
index 745fec1341..0000000000
--- a/main/install/_compare_db.php
+++ /dev/null
@@ -1,271 +0,0 @@
- 'Field', 1 => 'Type', 2 => 'Null', 3 => 'Key', 4 => 'Default', 5 => 'Extra');
-
-/********************************/
-
-$all_db_changes = array();
-
-echo "
Databases structure comparison script
";
-
-// Iterate through databases given above (checking from the 'new' database side)
-foreach ($bases_new as $num_base => $base) {
-
- //init tables lists for this database
- $modif_tables = array();
- $tables_db_new = array();
- $tables_db_old = array();
- $dump = array();
-
- // Display current processed database
- echo "
Now analysing differences between databases $base and ".$bases_old[$num_base]."
";
-
- // Get a list of tables for this database
- $query_new = "SHOW TABLES FROM ".$bases_new[$num_base];
- $result_new = mysql_query($query_new, $db_new);
-
- if ($result_new) { //if there are tables in this database
-
- $i=0;
-
- //as there are tables, process them one by one
- while ($row_new = mysql_fetch_row($result_new)) {
-
- $dump[$i]['table_name'] = $row_new[0];
- $dump[$i]['fields'] = array();
-
- $query_old = "SHOW FIELDS FROM ".$bases_new[$num_base].".".$row_new[0];
- $result_old = mysql_query($query_old,$db_old) or die(mysql_error());
-
- $j=0;
-
- //get the fields details (numbered fields)
- while ($row_old = mysql_fetch_row($result_old)) {
-
- $dump[$i]['fields'][$j][0] = $row_old[0];
- $dump[$i]['fields'][$j][1] = $row_old[1];
- $dump[$i]['fields'][$j][2] = $row_old[2];
- $dump[$i]['fields'][$j][3] = $row_old[3];
- $dump[$i]['fields'][$j][4] = $row_old[4];
- $dump[$i]['fields'][$j][5] = $row_old[5];
- //get the field name in one special element of this array
- $dump[$i]['field_names'][$row_old[0]] = $j;
-
- $j++;
- }
-
- $i++;
- }
-
- foreach ($dump as $table) {
-
- $query = "SHOW FIELDS FROM ".$bases_old[$num_base].".".$table['table_name'];
- $result = mysql_query($query,$db_old);
-
- if (!$result) {
-
- $modif_tables[]='**'.$table['table_name'].'**';
-
- } else {
-
- $i = 0;
-
- //check for removed, new or modified fields
- $fields_old = array();
- $fields_new = array();
-
- //list the new fields in a enumeration array
- foreach ($table['field_names'] as $dummy_key => $dummy_field) {
- $fields_new[] = $dummy_key;
- }
-
- //list the old fields in an enumeration array and check if their corresponding field in the new table is different (if any)
- $modif_fields = array();
- while ($row_old = mysql_fetch_row($result)) {
-
- $fields_old[] = $row_old[0];
- $modif_field = '';
-
- if (isset($table['fields'][$table['field_names'][$row_old[0]]])) {
- $field_info = $table['fields'][$table['field_names'][$row_old[0]]];
- foreach ($row_old as $key => $enreg) {
- //if the old field information of this kind doesn't match the new, record it
- if ($row_old[$key] != $field_info[$key]) {
- $modif_field .= '~+~'.$field_details[$key].'~+~,';
- break;
- }
- }
- //only record the whole stuff if the string is not empty
- if (strlen($modif_field) > 0) {
- $modif_fields[$row_old[0]] .= substr($modif_field, 0, -1);
- }
- }
- }
-
- $new_fields = array_diff($fields_new, $fields_old);
- foreach ($new_fields as $dummy => $val) {
- $new_fields[$dummy] = '++'.$val.'++';
- }
-
- $old_fields = array_diff($fields_old, $fields_new);
- foreach ($old_fields as $dummy => $val) {
- $old_fields[$dummy] = '--'.$val.'--';
- }
-
- if (count($old_fields) > 0 or count($modif_fields) > 0 or count($new_fields) > 0 ) {
- $modif_tables[] = array(
- 'table' => $table['table_name'],
- 'old_fields' => $old_fields,
- 'changed_fields' => $modif_fields,
- 'new_fields' => $new_fields,
- );
- }
- }
- $tables_db_new[] = $table['table_name'];
- }
-
- $query = "SHOW TABLES FROM ".$bases_old[$num_base];
- $result = mysql_query($query, $db_old) or die(mysql_error());
-
- while ($row = mysql_fetch_row($result)) {
- $tables_db_old[] = $row[0];
- }
-
- $diff = array_diff($tables_db_old, $tables_db_new);
-
- foreach ($diff as $enreg) {
- $modif_tables[] = '---'.$enreg.'---';
- }
- //$modif_tables = array_unique($modif_tables); //deprecated with the structure complexification
-
- } else { //this database was removed in the new version
-
- $query = "SHOW TABLES FROM ".$bases_old[$num_base];
- $result = mysql_query($query, $db_old) or die(mysql_error());
-
- while ($row = mysql_fetch_row($result)) {
- $tables_db_old[] = $row[0];
- }
-
- $diff = array_diff($tables_db_old, $tables_db_new);
-
- foreach ($diff as $enreg) {
- $modif_tables[] = '---'.$enreg.'---';
- }
-
- $modif_tables = array_unique($modif_tables);
- echo "
This database has been removed!
";
- }
- echo "
Differences between each table
" .
- "- fields display under each table's name, " .
- "- new tables are surrounded by '**', " .
- "- removed tables are surrounded by '---', " .
- "- new fields are surrounded by '++', " .
- "- removed fields are surrounded by '--', " .
- "- modified fields are surrounded by '~+~', ";
- echo '
";
-
-//going through all databases changes
-foreach ($all_db_changes as $base => $changes) {
- echo "
SQL for DB $base
";
-
- foreach ($changes as $table) {
-
- if (is_array($table)) {
- //we have a field-level difference
- $mytable = $table['table'];
- $myold = $table['old_fields'];
- $mychanged = $table['changed_fields'];
- $mynew = $table['new_fields'];
-
- foreach ($myold as $myname) {
- //column lost, display DROP command
- $myname = str_replace('--', '', $myname);
- echo "ALTER TABLE ".$mytable." DROP ".$myname." ";
- }
-
- foreach ($mychanged as $myname => $myprop) {
- //field changed, display SET command
- $myprops = split(',', $myprop);
- $myprops_string = '';
- foreach ($myprops as $myprop) {
- $myprop = str_replace('~+~', '', $myprop);
- $myprops_string .= $myprop." ";
- }
- echo "ALTER TABLE ".$mytable." CHANGE $myname $myname $myprops_string ";
- }
-
- foreach ($mynew as $myname) {
- //column created, display ADD command
- $myname = str_replace('++', '', $myname);
- echo "ALTER TABLE ".$mytable." ADD $myname... ";
- }
-
- } else {
-
- //we have a table-level difference
- $open_tag = substr($table, 0, 2);
- switch ($open_tag) {
- case '**':
- //new table, display CREATE TABLE command
- $table = str_replace('**', '', $table);
- echo "CREATE TABLE ".$table."(); ";
- break;
- case '--':
- //dropped table, display DROP TABLE command
- $table = str_replace('---', '', $table);
- echo "DROP TABLE ".$table."(); ";
- break;
- default:
- echo "Unknown table problem: ".$table." ";
- break;
- }
- }
- }
-}
diff --git a/main/install/_install_functions.inc.php b/main/install/_install_functions.inc.php
deleted file mode 100644
index 59fba59608..0000000000
--- a/main/install/_install_functions.inc.php
+++ /dev/null
@@ -1,1133 +0,0 @@
-, Ghent University
- */
-function step_active($param) {
- global $current_step;
- if ($param == $current_step) {
- echo 'class="current_step" ';
- }
-}
-
-/**
- * This function displays the Step X of Y -
- * @return string String that says 'Step X of Y' with the right values
- */
-function display_step_sequence() {
- global $current_step;
- global $total_steps;
- return get_lang('Step'.$current_step).' – ';
-}
-
-/**
- * This function checks if a php extension exists or not and returns an HTML
- * status string.
- *
- * @param string Name of the PHP extension to be checked
- * @param string Text to show when extension is available (defaults to 'OK')
- * @param string Text to show when extension is available (defaults to 'KO')
- * @param boolean Whether this extension is optional (in this case show unavailable text in orange rather than red)
- * @return string HTML string reporting the status of this extension. Language-aware.
- * @author Christophe Gesché
- * @author Patrick Cool , Ghent University
- * @author Yannick Warnier
- * @version Dokeos 1.8.1, May 2007
- */
-function check_extension($extension_name, $return_success = 'Yes', $return_failure = 'No', $optional = false) {
- if (extension_loaded($extension_name)) {
- return ''.$return_success.'';
- } else {
- if ($optional) {
- return ''.$return_failure.'';
- } else {
- return ''.$return_failure.'';
- }
- }
-}
-
-/**
- * This function checks whether a php setting matches the recommended value
- *
- * @author Patrick Cool , Ghent University
- * @version Dokeos 1.8, august 2006
- */
-function check_php_setting($php_setting, $recommended_value, $return_success = false, $return_failure = false) {
- $current_php_value = get_php_setting($php_setting);
- if ($current_php_value == $recommended_value) {
- return ''.$current_php_value.' '.$return_success.'';
- } else {
- return ''.$current_php_value.' '.$return_failure.'';
- }
-}
-
-/**
- * Returns a textual value ('ON' or 'OFF') based on a requester 2-state ini- configuration setting.
- *
- * @param string $val a php ini value
- * @return boolean: ON or OFF
- * @author Joomla
- */
-function get_php_setting($val) {
- return ini_get($val) == '1' ? 'ON' : 'OFF';
-}
-
-/**
- * This function checks if the given folder is writable
- */
-function check_writable($folder, $suggestion = false) {
- if (is_writable('../'.$folder)) {
- return ''.get_lang('Writable').'';
- } else {
- if ($suggestion) {
- return ''.get_lang('NotWritable').'';
- } else {
- return ''.get_lang('NotWritable').'';
- }
- }
-}
-
-/**
- * This function returns a string "true" or "false" according to the passed parameter.
- *
- * @param integer $var The variable to present as text
- * @return string the string "true" or "false"
- * @author Christophe Gesché
- */
-function true_false($var) {
- return $var ? 'true' : 'false';
-}
-
-/**
- * This function is similar to the core file() function, except that it
- * works with line endings in Windows (which is not the case of file())
- * @param string File path
- * @return array The lines of the file returned as an array
- */
-function file_to_array($filename) {
- $fp = fopen($filename, 'rb');
- $buffer = fread($fp, filesize($filename));
- fclose($fp);
- return explode(' ', nl2br($buffer));
-}
-
-/**
- * This function returns the value of a parameter from the configuration file
- *
- * WARNING - this function relies heavily on global variables $updateFromConfigFile
- * and $configFile, and also changes these globals. This can be rewritten.
- *
- * @param string $param the parameter of which the value is returned
- * @param string If we want to give the path rather than take it from POST
- * @return string the value of the parameter
- * @author Olivier Brouckaert
- * @author Reworked by Ivan Tcholakov, 2010
- */
-function get_config_param($param, $updatePath = '') {
- global $configFile, $updateFromConfigFile;
-
- // Look if we already have the queried parameter.
- if (is_array($configFile) && isset($configFile[$param])) {
- return $configFile[$param];
- }
- if (empty($updatePath) && !empty($_POST['updatePath'])) {
- $updatePath = $_POST['updatePath'];
- }
- $updatePath = realpath($updatePath).'/';
- $updateFromInstalledVersionFile = '';
-
- if (empty($updateFromConfigFile)) {
- // If update from previous install was requested,
- // try to recover old config file from dokeos 1.8.x.
- if (file_exists($updatePath.'main/inc/conf/configuration.php')) {
- $updateFromConfigFile = 'main/inc/conf/configuration.php';
- } elseif (file_exists($updatePath.'claroline/inc/conf/claro_main.conf.php')) {
- $updateFromConfigFile = 'claroline/inc/conf/claro_main.conf.php';
- } else {
- // Give up recovering.
- error_log('Could not find config file in '.$updatePath.' in get_config_param()', 0);
- return null;
- }
- }
-
- if (file_exists($updatePath.'main/inc/installedVersion.inc.php')) {
-
- $updateFromInstalledVersionFile = $updatePath.'main/inc/installedVersion.inc.php';
-
- } elseif (file_exists($updatePath.$updateFromConfigFile)) {
-
- // The parameter was not found among the global variables, so look into the old configuration file.
-
- // Make sure the installedVersion file is read first so it is overwritten
- // by the config file if the config file contains the version (from 1.8.4).
- $config_data_2 = array();
- if (file_exists($updatePath.$updateFromInstalledVersionFile)) {
- $config_data_2 = file_to_array($updatePath.$updateFromInstalledVersionFile);
- }
- $configFile = array();
- $config_data = file_to_array($updatePath.$updateFromConfigFile);
- $config_data = array_merge($config_data, $config_data_2);
- $val = '';
-
- // Parse the configuration file, statement by statement (line by line, actually).
- foreach ($config_data as $php_statement) {
-
- if (strpos($php_statement, '=') !== false) {
- // Variable assignment statement have been detected (probably).
- // It is expected to be as follows:
- // $variable = 'some_value'; // A comment that is not mandatory.
-
- // Split the statement into its left and right sides.
- $php_statement = explode('=', $php_statement);
- $variable = trim($php_statement[0]);
- $value = $php_statement[1];
-
- if (substr($variable, 0, 1) == '$') {
- // We have for sure a php variable assignment detected.
-
- // On the left side: Retrieve the pure variable's name
- $variable = trim(str_replace('$', '', $variable));
-
- // On the right side: Remove the comment, if it exists.
- list($value) = explode(' //', $value);
- // Remove extra whitespace, if any. Remove the trailing semicolon (;).
- $value = substr(trim($value), 0, -1);
- // Remove surroundig quotes, restore escaped quotes.
- $value = str_replace('\"', '"', preg_replace('/^"|"$/', '', $value));
- $value = str_replace('\'', '"', preg_replace('/^\'|\'$/', '', $value));
-
- if (strtolower($value) == 'true') {
-
- // A boolean true value have been recognized.
- $value = 1;
-
- } elseif (strtolower($value) == 'false') {
-
- // A boolean false value have been recognized.
- $value = 0;
-
- } else {
-
- // Probably we have a string value, but also we have to check
- // possible string concatenations that may include string values
- // and other configuration variables. I this case we have to
- // get the calculated result of the concatenation.
- $implode_string = ' ';
- if (!strstr($value, '." ".') && strstr($value, '.$')) {
- // Yes, there is concatenation, insert a special separator string.
- $value = str_replace('.$', '." ".$', $value);
- $implode_string = '';
- }
-
- // Split the concatenated values, if they are more than one.
- $sub_strings = explode('." ".', $value);
-
- // Seek for variables and retrieve their values.
- foreach ($sub_strings as $key => & $sub_string) {
- if (preg_match('/^\$[a-zA-Z_][a-zA-Z0-9_]*$/', $sub_string)) {
- // A variable has been detected, read it by recursive call.
- $sub_string = get_config_param(str_replace('$', '', $sub_string));
- }
- }
-
- // Concatenate everything into the final, the calculated string value.
- $value = implode($implode_string, $sub_strings);
- }
-
- // Cache the result value.
- $configFile[$variable] = $value;
-
- $a = explode("'", $variable);
- $key_tmp = $a[1];
- if ($key_tmp == $param) {
- $val = $value;
- }
- }
- }
- }
-
- return $val;
-
- } else {
- error_log('Config array could not be found in get_config_param()', 0);
- return null;
- }
-}
-
-/**
- * Get the config param from the database. If not found, return null
- * @param string DB Host
- * @param string DB login
- * @param string DB pass
- * @param string DB name
- * @param string Name of param we want
- * @return mixed The parameter value or null if not found
- */
-function get_config_param_from_db($host, $login, $pass, $db_name, $param = '') {
-
- Database::connect(array('server' => $host, 'username' => $login, 'password' => $pass));
- Database::query("set session sql_mode='';"); // Disabling special SQL modes (MySQL 5)
- Database::select_db($db_name);
-
- if (($res = Database::query("SELECT * FROM settings_current WHERE variable = '$param'")) !== false) {
- if (Database::num_rows($res) > 0) {
- $row = Database::fetch_array($res);
- return $row['selected_value'];
- }
- }
- return null;
-}
-
-/*
-==============================================================================
- DISPLAY FUNCTIONS
-==============================================================================
-*/
-
-/**
- * Displays a drop down box for selection the preferred language.
- */
-function display_language_selection_box($name = 'language_list', $default_language = 'english') {
- // Reading language list.
- $language_list = get_language_folder_list();
-
- /*
- // Reduction of the number of languages shown. Enable this fragment of code for customization purposes.
- // Modify the language list according to your preference. Don't exclude the 'english' item.
- $language_to_display = array('asturian', 'bulgarian', 'english', 'italian', 'french', 'slovenian', 'slovenian_unicode', 'spanish');
- foreach ($language_list as $key => & $value) {
- if (!in_array($key, $language_to_display)) {
- unset($language_list[$key]);
- }
- }
- */
-
- // Sanity checks due to the possibility for customizations.
- if (!is_array($language_list) || empty($language_list)) {
- $language_list = array('english' => 'English');
- }
-
- // Sorting again, if it is necessary.
- //asort($language_list);
-
- // More sanity checks.
- if (!array_key_exists($default_language, $language_list)) {
- if (array_key_exists('english', $language_list)) {
- $default_language = 'english';
- } else {
- $language_keys = array_keys($language_list);
- $default_language = $language_keys[0];
- }
- }
-
- // Displaying the box.
- echo "\t\t\n";
-}
-
-/**
- * This function displays a language dropdown box so that the installatioin
- * can be done in the language of the user
- */
-function display_language_selection() { ?>
-
-
-
';
-
- // RECOMMENDED SETTINGS
- // Note: these are the settings for Joomla, does this also apply for Dokeos?
- // Note: also add upload_max_filesize here so that large uploads are possible
- echo '
';
- }
-}
-
-/**
- * Displays the license (GNU GPL) as step 2, with
- * - an "I accept" button named step3 to proceed to step 3;
- * - a "Back" button named step1 to go back to the first step.
- */
-function display_license_agreement() {
- echo '
';
- echo get_lang('DBSettingUpgradeIntro');
-
- } else {
-
- if (empty($dbPrefixForm)) { //make sure there is a default value for db prefix
- $dbPrefixForm = 'chamilo_';
- }
- echo '