Remove unused $_configuration values.

1.10.x
Julio Montoya 11 years ago
parent 810d17fa90
commit 98be672efa
  1. 4
      main/admin/course_request_edit.php
  2. 7
      main/inc/global.inc.php
  3. 1
      main/inc/lib/api.lib.php
  4. 5
      main/inc/lib/course.lib.php
  5. 1
      main/inc/lib/login.lib.php
  6. 62
      main/install/configuration.dist.php
  7. 61
      main/install/install.lib.php
  8. 3
      main/webservices/registration.soap.php
  9. 1
      tests/test_manager.inc.php

@ -31,10 +31,8 @@ if ($course_validation_feature) {
$is_error_message = true;
} else {
global $_configuration;
$dbnamelength = strlen($_configuration['db_prefix']);
// Ensure the database prefix + database name do not get over 40 characters.
$maxlength = 40 - $dbnamelength;
$maxlength = 40;
// Build the form.
$form = new FormValidator('add_course', 'post', 'course_request_edit.php?id='.$id.'&caller='.$caller);

@ -115,13 +115,6 @@ if (!is_dir(_MPDF_TEMP_PATH)) {
mkdir(_MPDF_TEMP_PATH, api_get_permissions_for_new_directories(), true);
}
/* DATABASE CONNECTION */
// @todo: this shouldn't be done here. It should be stored correctly during installation.
if (empty($_configuration['statistics_database']) && $already_installed) {
$_configuration['statistics_database'] = $_configuration['main_database'];
}
global $database_connection;
// Connect to the server database and select the main chamilo database.
// When $_configuration['db_persistent_connection'] is set, it is expected to be a boolean type.
$dbPersistConnection = api_get_configuration_value('db_persistent_connection');

@ -1783,7 +1783,6 @@ function api_format_course_array($course_data) {
$_course['dbName'] = $course_data['db_name'];
$_course['db_name'] = $course_data['db_name'];
// Use in all queries.
$_course['dbNameGlu'] = $_configuration['table_prefix'] . $course_data['db_name'] . $_configuration['db_glue'];
$_course['titular'] = $course_data['tutor_name'];
$_course['language'] = $course_data['course_language'];

@ -2237,11 +2237,6 @@ class CourseManager
*/
public static function create_database_dump($course_code)
{
global $_configuration;
if ($_configuration['single_database']) {
return;
}
$sql_dump = '';
$course_code = Database::escape_string($course_code);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);

@ -357,7 +357,6 @@ class Login
$_course['path'] = $course_data['directory']; // use as key in path
$_course['dbName'] = $course_data['db_name']; // use as key in db list
$_course['db_name'] = $course_data['db_name']; // not needed in Chamilo 1.9
$_course['dbNameGlu'] = $_configuration['table_prefix'] . $course_data['db_name'] . $_configuration['db_glue']; // use in all queries //not needed in Chamilo 1.9
$_course['titular'] = $course_data['tutor_name']; // this should be deprecated and use the table course_rel_user
$_course['language'] = $course_data['course_language'];
$_course['extLink']['url'] = $course_data['department_url'];

@ -21,19 +21,19 @@
* contains variables that can be changed and will not break the platform.
* These optional settings are defined in the database, now
* (table settings_current).
* example: $_configuration['tracking_enabled'] (assuming that the install
* script creates the necessary tables anyway).
*/
/**
* MYSQL connection settings
* Database connection settings
*/
// Your MySQL server
$_configuration['db_host'] = '{DATABASE_HOST}';
$_configuration['db_host'] = '{DATABASE_HOST}';
// Your MySQL username
$_configuration['db_user'] = '{DATABASE_USER}';
$_configuration['db_user'] = '{DATABASE_USER}';
// Your MySQL password
$_configuration['db_password'] = '{DATABASE_PASSWORD}';
// main Chamilo database
$_configuration['main_database'] = '{DATABASE_MAIN}';
// Persistent connections may have profound effects (not always positive) on
// your database server. Use with care.
@ -43,26 +43,6 @@ $_configuration['db_password'] = '{DATABASE_PASSWORD}';
// the following to enable compression.
//$_configuration['db_client_flags'] = MYSQL_CLIENT_COMPRESS;
/**
* Database settings
*/
// Is tracking enabled?
$_configuration['tracking_enabled'] = TRACKING_ENABLED;
// Is single database enabled (DO NOT MODIFY THIS)
$_configuration['single_database'] = SINGLE_DATABASE;
// Prefix for course tables (IF NOT EMPTY, can be replaced by another prefix, else leave empty)
$_configuration['table_prefix'] = '{COURSE_TABLE_PREFIX}';
// Separator between database and table name (DO NOT MODIFY THIS)
$_configuration['db_glue'] = '{DATABASE_GLUE}';
// prefix all created bases (for courses) with this string
$_configuration['db_prefix'] = '{DATABASE_PREFIX}';
// main Chamilo database
$_configuration['main_database'] = '{DATABASE_MAIN}';
// stats Chamilo database
$_configuration['statistics_database'] ='{DATABASE_STATS}';
// User Personal Database (where all the personal stuff of the user is stored
// (personal agenda items, course sorting)
$_configuration['user_personal_database']='{DATABASE_PERSONAL}';
// Enable access to database management for platform admins.
$_configuration['db_manager_enabled'] = false;
@ -70,23 +50,23 @@ $_configuration['db_manager_enabled'] = false;
* Directory settings
*/
// URL to the root of your Chamilo installation, e.g.: http://www.mychamilo.com/
$_configuration['root_web'] = '{ROOT_WEB}';
$_configuration['root_web'] = '{ROOT_WEB}';
// Path to the webroot of system, example: /var/www/
$_configuration['root_sys'] = '{ROOT_SYS}';
$_configuration['root_sys'] = '{ROOT_SYS}';
// Path from your WWW-root to the root of your Chamilo installation, example: chamilo (this means chamilo is installed in /var/www/chamilo/
$_configuration['url_append'] = '{URL_APPEND_PATH}';
$_configuration['url_append'] = '{URL_APPEND_PATH}';
// Directory of the Chamilo code. You could change this but it is not advised since this has not been tested yet.
$_configuration['code_append'] = "main/";
$_configuration['code_append'] = "main/";
// Directory to store all course-related files. You could change this but it is not advised since this has not been tested yet.
$_configuration['course_folder'] = "courses/";
$_configuration['course_folder'] = "courses/";
// URL to your phpMyAdmin installation.
// If not empty, a link will be available in the Platform Administration
$_configuration['db_admin_path'] = '';
$_configuration['db_admin_path'] = '';
/**
* Login modules settings
@ -154,7 +134,7 @@ $_configuration['cdn'] = array(
//You can define several CDNs and split them by extensions
//Replace the following by your full CDN URL, which should point to
// your Chamilo's root directory. DO NOT INCLUDE a final slash! (won't work)
'http://cdn.chamilo.org' => array('.css','.js','.jpg','.jpeg','.png','.gif','.avi','.flv'),
'http://cdn.chamilo.org' => array('.css','.js','.jpg','.jpeg','.png','.gif','.avi','.flv'),
// copy the line above and modify following your needs
);
@ -162,24 +142,24 @@ $_configuration['cdn'] = array(
* Misc. settings
*/
// Verbose backup
$_configuration['verbose_backup'] = false;
$_configuration['verbose_backup'] = false;
// security word for password recovery
$_configuration['security_key'] = '{SECURITY_KEY}';
$_configuration['security_key'] = '{SECURITY_KEY}';
// Hash function method
$_configuration['password_encryption'] = '{ENCRYPT_PASSWORD}';
$_configuration['password_encryption'] = '{ENCRYPT_PASSWORD}';
// You may have to restart your web server if you change this
$_configuration['session_stored_in_db'] = false;
$_configuration['session_stored_in_db'] = false;
// Session lifetime
$_configuration['session_lifetime'] = SESSION_LIFETIME;
$_configuration['session_lifetime'] = SESSION_LIFETIME;
// Activation for multi-url access
//$_configuration['multiple_access_urls'] = true;
$_configuration['software_name'] = 'Chamilo';
$_configuration['software_url'] = 'http://www.chamilo.org/';
$_configuration['software_name'] = 'Chamilo';
$_configuration['software_url'] = 'http://www.chamilo.org/';
//Deny the elimination of users
$_configuration['deny_delete_users'] = false;
// Version settings
$_configuration['system_version'] = '{NEW_VERSION}';
$_configuration['system_stable'] = NEW_VERSION_STABLE;
$_configuration['system_version'] = '{NEW_VERSION}';
$_configuration['system_stable'] = NEW_VERSION_STABLE;
/**
* Settings to be included as settings_current in future versions

@ -313,11 +313,7 @@ function write_system_config_file($path)
global $dbPassForm;
global $enableTrackingForm;
global $singleDbForm;
global $dbPrefixForm;
global $dbNameForm;
global $dbStatsForm;
global $dbScormForm;
global $dbUserForm;
global $urlForm;
global $pathForm;
global $urlAppendPath;
@ -332,29 +328,21 @@ function write_system_config_file($path)
$root_sys = api_add_trailing_slash(str_replace('\\', '/', realpath($pathForm)));
$content = file_get_contents(dirname(__FILE__).'/'.SYSTEM_CONFIG_FILENAME);
$config['{DATE_GENERATED}'] = date('r');
$config['{DATABASE_HOST}'] = $dbHostForm;
$config['{DATABASE_USER}'] = $dbUsernameForm;
$config['{DATABASE_PASSWORD}'] = $dbPassForm;
$config['TRACKING_ENABLED'] = trueFalse($enableTrackingForm);
$config['SINGLE_DATABASE'] = trueFalse($singleDbForm);
$config['{COURSE_TABLE_PREFIX}'] = ($singleDbForm ? 'crs_' : '');
$config['{DATABASE_GLUE}'] = ($singleDbForm ? '_' : '`.`');
$config['{DATABASE_PREFIX}'] = '';
$config['{DATABASE_MAIN}'] = $dbNameForm;
$config['{DATABASE_STATS}'] = $dbNameForm;
$config['{DATABASE_SCORM}'] = $dbNameForm;
$config['{DATABASE_PERSONAL}'] = $dbNameForm;
$config['{ROOT_WEB}'] = $urlForm;
$config['{ROOT_SYS}'] = $root_sys;
$config['{URL_APPEND_PATH}'] = $urlAppendPath;
$config['{PLATFORM_LANGUAGE}'] = $languageForm;
$config['{SECURITY_KEY}'] = md5(uniqid(rand().time()));
$config['{ENCRYPT_PASSWORD}'] = $encryptPassForm;
$config['SESSION_LIFETIME'] = $session_lifetime;
$config['{NEW_VERSION}'] = $new_version;
$config['NEW_VERSION_STABLE'] = trueFalse($new_version_stable);
$config['{DATE_GENERATED}'] = date('r');
$config['{DATABASE_HOST}'] = $dbHostForm;
$config['{DATABASE_USER}'] = $dbUsernameForm;
$config['{DATABASE_PASSWORD}'] = $dbPassForm;
$config['{DATABASE_MAIN}'] = $dbNameForm;
$config['{ROOT_WEB}'] = $urlForm;
$config['{ROOT_SYS}'] = $root_sys;
$config['{URL_APPEND_PATH}'] = $urlAppendPath;
$config['{PLATFORM_LANGUAGE}'] = $languageForm;
$config['{SECURITY_KEY}'] = md5(uniqid(rand().time()));
$config['{ENCRYPT_PASSWORD}'] = $encryptPassForm;
$config['SESSION_LIFETIME'] = $session_lifetime;
$config['{NEW_VERSION}'] = $new_version;
$config['NEW_VERSION_STABLE'] = trueFalse($new_version_stable);
foreach ($config as $key => $value) {
$content = str_replace($key, $value, $content);
@ -1820,27 +1808,8 @@ function display_database_settings_form(
$dbHostForm = $_configuration['db_host'];
$dbUsernameForm = $_configuration['db_user'];
$dbPassForm = $_configuration['db_password'];
$dbPrefixForm = $_configuration['db_prefix'];
$enableTrackingForm = $_configuration['tracking_enabled'];
$singleDbForm = $_configuration['single_database'];
$dbNameForm = $_configuration['main_database'];
$dbStatsForm = $_configuration['statistics_database'];
$dbScormForm = $_configuration['scorm_database'];
$dbUserForm = $_configuration['user_personal_database'];
$dbScormExists = true;
if (empty($dbScormForm)) {
if ($singleDbForm) {
$dbScormForm = $dbNameForm;
} else {
$dbScormForm = $dbPrefixForm.'scorm';
$dbScormExists = false;
}
}
if (empty($dbUserForm)) {
$dbUserForm = $singleDbForm ? $dbNameForm : $dbPrefixForm.'chamilo_user';
}
echo '<div class="RequirementHeading"><h2>' . display_step_sequence() .get_lang('DBSetting') . '</h2></div>';
echo '<div class="RequirementContent">';
echo get_lang('DBSettingUpgradeIntro');

@ -2541,9 +2541,8 @@ function WSCreateCourseByTitle($params) {
$orig_course_id_value[] = $course_param['original_course_id_value'];
$extra_list = $course_param['extra'];
$dbnamelength = strlen($_configuration['db_prefix']);
// Ensure the database prefix + database name do not get over 40 characters
$maxlength = 40 - $dbnamelength;
$maxlength = 40;
if (empty($wanted_code)) {
$wanted_code = CourseManager::generate_course_code(substr($title, 0, $maxlength));

@ -155,7 +155,6 @@ function create_test_course($course_code = 'TESTCOURSE') {
$_course['sysCode' ] = $cData['code' ]; // use as key in db
$_course['path' ] = $cData['directory' ]; // use as key in path
$_course['dbName' ] = $cData['db_name' ]; // use as key in db list
$_course['dbNameGlu' ] = $_configuration['table_prefix'] . $cData['db_name'] . $_configuration['db_glue']; // use in all queries
$_course['titular' ] = $cData['tutor_name' ];
$_course['language' ] = $cData['course_language' ];
$_course['extLink' ]['url' ] = $cData['department_url' ];

Loading…
Cancel
Save