More changes in the configuration.file see #6104

skala
Julio Montoya 12 years ago
parent 6e1279f783
commit 96a244b18c
  1. 2
      console-config.php
  2. 2
      console.php
  3. 50
      main/inc/global.inc.php
  4. 4
      main/inc/lib/course.lib.php
  5. 6
      main/inc/lib/database.lib.php
  6. 2
      main/inc/lib/login.lib.php
  7. 66
      main/install/configuration.dist.php
  8. 30
      main/install/configuration.dist.yml.php
  9. 4
      main/install/update-db-1.9.0-1.10.0.inc.php
  10. 4
      tests/doctrine_console/cli-config.php
  11. 2
      tests/test_manager.inc.php

@ -29,7 +29,7 @@ $connectionOptions = array();
if (!empty($courseList)) {
$dbPrefix = isset($_configuration['db_prefix']) && !empty($_configuration['db_prefix']) ? $_configuration['db_prefix'].$_configuration['db_glue'] : null;
$dbPrefix = isset($_configuration['db_prefix']) && !empty($_configuration['db_prefix']) ? $_configuration['db_prefix'].Database::get_database_glue() : null;
foreach ($courseList as $course) {
$connectionOptions['_chamilo_course_'.$course['db_name']] = array(
'driver' => 'pdo_mysql',

@ -59,7 +59,7 @@ $cli->addCommands(array(
//new ChamiloLMS\Command\Template\AsseticDumpCommand(),
//Chash commands
// Chash commands
new Chash\Command\Database\RunSQLCommand(),
new Chash\Command\Database\DumpCommand(),
new Chash\Command\Database\RestoreCommand(),

@ -35,23 +35,13 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Yaml\Parser;
// Determine the directory path for this file
$includePath = dirname(__FILE__);
// Start Silex
$app = new Application();
// Setting paths
$app['root_sys'] = dirname(dirname(__DIR__)).'/';
$app['sys_data_path'] = $app['root_sys'].'data/';
$app['sys_config_path'] = $app['root_sys'].'config/';
$app['sys_temp_path'] = $app['root_sys'].'temp/';
$app['sys_log_path'] = $app['root_sys'].'logs/';
// @todo add a helper to read the configuration file once!
// Reading configuration file from main/inc/conf/configuration.php or app/config/configuration.yml
// Determine the directory path for this file.
$includePath = dirname(__FILE__);
// Include the main Chamilo platform configuration file.
// @todo use a service provider to load configuration files:
@ -59,7 +49,8 @@ $includePath = dirname(__FILE__);
$app->register(new Igorw\Silex\ConfigServiceProvider($settingsFile));
*/
/** Loading configuration files */
/** Loading configuration file */
// Reading configuration file from main/inc/conf/configuration.php or app/config/configuration.yml
$configurationFilePath = $includePath.'/conf/configuration.php';
$configurationYMLFile = $includePath.'/../../config/configuration.yml';
$configurationFileAppPath = $includePath.'/../../config/configuration.php';
@ -91,15 +82,22 @@ if (file_exists($configurationYMLFile)) {
}
}
}
// End reading configuration file
/** Setting paths */
$app['root_sys'] = isset($_configuration['root_sys']) ? $_configuration['root_sys'] : dirname(dirname(__DIR__)).'/';
$app['sys_data_path'] = isset($_configuration['sys_data_path']) ? $_configuration['sys_data_path'] : $app['root_sys'].'data/';
$app['sys_config_path'] = isset($_configuration['sys_config_path']) ? $_configuration['sys_config_path'] : $app['root_sys'].'config/';
$app['sys_temp_path'] = isset($_configuration['sys_temp_path']) ? $_configuration['sys_temp_path'] : $app['root_sys'].'temp/';
$app['sys_log_path'] = isset($_configuration['sys_log_path']) ? $_configuration['sys_log_path'] : $app['root_sys'].'logs/';
/** Loading legacy libs */
// Include the main Chamilo platform library file.
require_once $includePath.'/lib/main_api.lib.php';
// Setting url_append
$_configuration['url_append'] = '/'.basename(str_replace(api_get_path(WEB_SERVER_ROOT_PATH), '', api_get_path(WEB_PATH)));
// Setting url_append @ŧodo improve this replace
$_configuration['url_append'] = '/'.basename(str_replace($_SERVER['HTTP_HOST'], '', $_configuration['root_web']));
// Inclusion of internationalization libraries
require_once $includePath.'/lib/internationalization.lib.php';
@ -107,7 +105,7 @@ require_once $includePath.'/lib/internationalization.lib.php';
// Functions for internal use behind this API
require_once $includePath.'/lib/internationalization_internal.lib.php';
// Do not over-use this variable. It is only for this script's local use.
// Do not over-use this variable. It is only for this scripts local use.
$libPath = $includePath.'/lib/';
// Database constants
@ -116,9 +114,12 @@ require_once $libPath.'database.constants.inc.php';
// @todo Rewrite the events.lib.inc.php in a class
require_once $libPath.'events.lib.inc.php';
// Load allowed tag definitions for kses and/or HTMLPurifier.
require_once $libPath.'formvalidator/Rule/allowed_tags.inc.php';
/** Loading config files */
if ($alreadyInstalled) {
$configPath = $includePath.'/../../config/';
$configPath = $app['sys_config_path'];
$confFiles = array(
'auth.conf.php',
@ -141,19 +142,19 @@ if ($alreadyInstalled) {
$administrator['name'] = isset($administrator['name']) ? $administrator['name'] : 'Admin';
// Code for transitional purposes, it can be removed right before the 1.8.7 release.
if (empty($_configuration['system_version'])) {
/*if (empty($_configuration['system_version'])) {
$_configuration['system_version'] = (!empty($_configuration['dokeos_version']) ? $_configuration['dokeos_version'] : '');
$_configuration['system_stable'] = (!empty($_configuration['dokeos_stable']) ? $_configuration['dokeos_stable'] : '');
$_configuration['software_url'] = 'http://www.chamilo.org/';
}
}*/
// For backward compatibility.
$_configuration['dokeos_version'] = $_configuration['system_version'];
$_configuration['dokeos_stable'] = $_configuration['system_stable'];
//$_configuration['dokeos_stable'] = $_configuration['system_stable'];
$userPasswordCrypted = (!empty($_configuration['password_encryption']) ? $_configuration['password_encryption'] : 'sha1');
}
/* RETRIEVING ALL THE CHAMILO CONFIG SETTINGS FOR MULTIPLE URLs FEATURE*/
/* RETRIEVING ALL THE CHAMILO CONFIG SETTINGS FOR MULTIPLE URLs FEATURE */
if (isset($_configuration['multiple_access_urls']) && !empty($_configuration['multiple_access_urls'])) {
$_configuration['access_url'] = 1;
$access_urls = api_get_access_urls();
@ -645,8 +646,7 @@ if ($alreadyInstalled && $checkConnection) {
}
}
// Load allowed tag definitions for kses and/or HTMLPurifier.
require_once $libPath.'formvalidator/Rule/allowed_tags.inc.php';
// Section (tabs in the main chamilo menu)
$app['this_section'] = SECTION_GLOBAL;

@ -1017,9 +1017,9 @@ class CourseManager
$sql .= ' FROM '.Database::get_main_table(TABLE_MAIN_USER).' as user ';
$sql .= ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_COURSE_USER).' as course_rel_user
ON user.user_id = course_rel_user.user_id AND
course_rel_user.relation_type <> '.COURSE_RELATION_TYPE_RRHH.' ';
course_rel_user.relation_type <> '.COURSE_RELATION_TYPE_RRHH;
if (!empty($course_code)) {
$sql .= ' AND course_rel_user.c_id = "'.$courseInfo['real_id'].'"';
$sql .= " AND course_rel_user.c_id = ".$courseInfo['real_id'];
} else {
$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql .= " INNER JOIN $course_table course ON course_rel_user.c_id = course.id";

@ -87,9 +87,9 @@ class Database
*/
public static function get_database_glue()
{
global $_configuration;
return $_configuration['db_glue'];
/*global $_configuration;
return $_configuration['db_glue'];*/
return `.`;
}
/**

@ -363,7 +363,7 @@ 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['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'];

@ -3,7 +3,7 @@
// File generated by /install/index.php script - {DATE_GENERATED}
/* For licensing terms, see /license.txt */
/**
* Virtual campus configuration
* Chamilo configuration
*
* This file contains a list of variables that can be modified by the campus
* site's server administrator. Pay attention when changing these variables,
@ -19,10 +19,7 @@
* Changing a $_configuration variable CAN generally break the installation.
* Besides the $_configuration, a $_settings array also exists, that
* 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).
* These optional settings are defined in the database, now (table settings_current).
*/
/**
@ -40,39 +37,37 @@ $_configuration['db_password'] = '{DATABASE_PASSWORD}';
*/
// 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}';
/**
* Directory settings
*/
/** Directory settings */
// URL to the root of your Chamilo installation, e.g.: http://www.mychamilo.com/
$_configuration['root_web'] = '{ROOT_WEB}';
// Path to the webroot of system, example: /var/www/
$_configuration['root_sys'] = '{ROOT_SYS}';
/** Chamilo will automatically manage all this paths */
// Path to the webroot of system, example: /var/www/chamilo
//$_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}';
// Path to the data folder, example /var/www/chamilo/data
//$_configuration['sys_data_path'] = null;
// 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/";
// Path to the config folder, example /var/www/chamilo/config
//$_configuration['sys_config_path'] = null;
// 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/";
// Path to the temp folder, example /var/www/chamilo/temp
//$_configuration['sys_temp_path'] = null;
// Path to the logs folder, example /var/www/chamilo/logs
//$_configuration['sys_log_path'] = null;
// URL to your phpMyAdmin installation.
// If not empty, a link will be available in the Platform Administration
$_configuration['db_admin_path'] = '';
/**
*
* Login modules settings
*/
/** Login modules settings */
// CAS IMPLEMENTATION
// -> Go to your portal Chamilo > Administration > CAS to activate CAS
// You can leave these lines uncommented even if you don't use CAS authentification
@ -133,22 +128,29 @@ $_configuration['cdn'] = array(
);
/**
* Misc. settings
* Session settings
*/
// Security word for password recovery
$_configuration['security_key'] = '{SECURITY_KEY}';
// Hash function method
$_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;
/** Security */
// Security word for password recovery
$_configuration['security_key'] = '{SECURITY_KEY}';
// Hash function method
$_configuration['password_encryption'] = '{ENCRYPT_PASSWORD}';
//Deny the elimination of users
$_configuration['deny_delete_users'] = false;
/** Multiple URL */
// Activation for multi-url access
//$_configuration['multiple_access_urls'] = true;
/** Chamilo version settings */
$_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_stable'] = NEW_VERSION_STABLE;

@ -1,28 +1,5 @@
<?php
// Chamilo version {NEW_VERSION}
// File generated by /install/index.php script - {DATE_GENERATED}
/* For licensing terms, see /license.txt */
/**
* Chamilo configuration
*
* This file contains a list of variables that can be modified by the campus
* site's server administrator. Pay attention when changing these variables,
* some changes may cause Chamilo to stop working.
* If you changed some settings and want to restore them, please have a look at
* configuration.dist.php. That file is an exact copy of the config file at
* install time.
*/
/**
* $_configuration define only the bare essential variables
* for configuring the platform (paths, database connections, ...).
* Changing a $_configuration variable CAN generally break the installation.
* Besides the $_configuration, a $_settings array also exists, that
* contains variables that can be changed and will not break the platform.
* These optional settings are defined in the database, now
* (table settings_current).
*/
/** This script is only use when using the console.php chamilo:install command */
/**
* MYSQL connection settings
*/
@ -38,8 +15,6 @@ $_configuration['db_password'] = 'root';
*/
// Prefix for course tables (IF NOT EMPTY, can be replaced by another prefix, else leave empty)
$_configuration['table_prefix'] = '';
// Separator between database and table name (DO NOT MODIFY THIS)
$_configuration['db_glue'] = '`.`';
// prefix all created bases (for courses) with this string
$_configuration['db_prefix'] = '';
// main Chamilo database
@ -50,9 +25,8 @@ $_configuration['main_database'] = 'chamilo';
*/
// URL to the root of your Chamilo installation, e.g.: http://www.mychamilo.com/
$_configuration['root_web'] = 'http://localhost/chamilo';
$_configuration['root_sys'] = '/var/www/chamilo';
/**
*
/**
* Misc. settings
*/

@ -220,7 +220,7 @@ if (defined('SYSTEM_INSTALLATION')) {
$sql = "INSERT INTO $dbNameForm.usergroup (name, group_type, description, picture, url, visibility, updated_on, created_on)
VALUES ('{$group['name']}', '1', '{$group['description']}', '{$group['picture_uri']}', '{$group['url']}', '{$group['visibility']}', '{$group['updated_on']}', '{$group['created_on']}')";
Database::query($sql);
$id = Database::get_last_insert_id();
$id = Database::insert_id();
$oldGroups[$group['id']] = $id;
}
}
@ -260,7 +260,7 @@ if (defined('SYSTEM_INSTALLATION')) {
$data['group_id'] = $oldGroups[$data['group_id']];
$data['subgroup_id'] = $oldGroups[$data['subgroup_id']];
$sql = "INSERT INTO $dbNameForm.usergroup_rel_usergroup (group_id, subgroup_id, relation_type)
VALUES ('{$data['group_id']}', '{$data['subgroup_id']}', '{$data['relation_type']}')";
VALUES ('{$data['group_id']}', '{$data['subgroup_id']}', '{$data['relation_type']}')";
Database::query($sql);
}
}

@ -1,4 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
require_once dirname(__FILE__).'/../../main/inc/global.inc.php';
$config = new \Doctrine\ORM\Configuration();
@ -32,7 +34,7 @@ $connectionOptions = array();
if (!empty($courseList)) {
$dbPrefix = isset($_configuration['db_prefix']) && !empty($_configuration['db_prefix']) ? $_configuration['db_prefix'].$_configuration['db_glue'] : null;
$dbPrefix = isset($_configuration['db_prefix']) && !empty($_configuration['db_prefix']) ? $_configuration['db_prefix'].Database::get_database_glue() : null;
foreach ($courseList as $course) {
$connectionOptions['_chamilo_course_'.$course['db_name']] = array(
'driver' => 'pdo_mysql',

@ -163,7 +163,7 @@ class TestManager
$_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['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