Feature #272 - Installation scripts: Renaming some lexems in the code (mostly).

skala
Ivan Tcholakov 15 years ago
parent 821f3995bc
commit b78abc370f
  1. 6
      main/install/index.php
  2. 4
      main/install/install_files.inc.php
  3. 18
      main/install/install_upgrade.lib.php
  4. 4
      main/install/update-files-1.6.x-1.8.0.inc.php
  5. 4
      main/install/update_files.inc.php

@ -246,7 +246,7 @@ if (!isset($_GET['running'])) {
} else {
foreach ($_POST as $key => $val) {
$magic_quotes_gpc = ini_get('magic_quotes_gpc') ? true : false;
$magic_quotes_gpc = ini_get('magic_quotes_gpc');
if (is_string($val)) {
if ($magic_quotes_gpc) {
$val = stripslashes($val);
@ -589,7 +589,7 @@ if ($_POST['step2']) {
?>
<?php echo get_lang('AdminPhone').' : '.$adminPhoneForm; ?><br />
<?php if($installType == 'new'): ?>
<?php if ($installType == 'new'): ?>
<?php echo get_lang('AdminLogin').' : <strong>'.$loginForm; ?></strong><br />
<?php echo get_lang('AdminPass').' : <strong>'.$passForm; /* TODO: Maybe this password should be hidden too? */ ?></strong><br /><br />
<?php else: ?>
@ -606,7 +606,7 @@ if ($_POST['step2']) {
<?php if ($installType == 'new'): ?>
<div style="background-color:#FFFFFF">
<p align="center"><strong><font color="red">
<?php echo get_lang('Warning');?> !<br />
<?php echo get_lang('Warning'); ?> !<br />
<?php echo get_lang('TheInstallScriptWillEraseAllTables'); ?>
</font></strong></p>
</div>

@ -18,10 +18,10 @@
if (defined('SYSTEM_INSTALLATION')) {
// Write the system config file
write_dokeos_config_file('../inc/conf/configuration.php');
write_system_config_file('../inc/conf/configuration.php');
// Write a distribution file with the config as a backup for the admin
write_dokeos_config_file('../inc/conf/configuration.dist.php');
write_system_config_file('../inc/conf/configuration.dist.php');
// Write a .htaccess file in the course repository
write_courses_htaccess_file($urlAppendPath);

@ -19,10 +19,10 @@
CONSTANTS
==============================================================================
*/
define("DOKEOS_MAIN_DATABASE_FILE", "dokeos_main.sql");
define("SYSTEM_MAIN_DATABASE_FILE", "dokeos_main.sql");
define("COUNTRY_DATA_FILENAME", "country_data.csv");
define("COURSES_HTACCESS_FILENAME", "htaccess.dist");
define("DOKEOS_CONFIG_FILENAME", "configuration.dist.php");
define("SYSTEM_CONFIG_FILENAME", "configuration.dist.php");
require_once api_get_path(LIBRARY_PATH).'database.lib.php';
@ -70,7 +70,7 @@ function write_courses_htaccess_file($url_append) {
* Write the main system config file
* @param string $path Path to the config file
*/
function write_dokeos_config_file($path) {
function write_system_config_file($path) {
global $dbHostForm;
global $dbUsernameForm;
@ -93,13 +93,9 @@ function write_dokeos_config_file($path) {
global $new_version;
global $new_version_stable;
// TODO: api_get_path() to be tested here.
$seek = array('\\', '//');
$destroy = array('/', '/');
$rootSys = str_replace($seek, $destroy, realpath($pathForm).'/');
$file_path = dirname(__FILE__).'/'.DOKEOS_CONFIG_FILENAME;
$root_sys = api_add_trailing_slash(str_replace('\\', '/', realpath($pathForm)));
$content = file_get_contents(dirname(__FILE__).'/'.SYSTEM_CONFIG_FILENAME);
$content = file_get_contents($file_path);
$config['{DATE_GENERATED}'] = date('r');
$config['{DATABASE_HOST}'] = $dbHostForm;
$config['{DATABASE_USER}'] = $dbUsernameForm;
@ -114,7 +110,7 @@ function write_dokeos_config_file($path) {
$config['{DATABASE_SCORM}'] = (($singleDbForm && empty($dbScormForm)) ? $dbNameForm : $dbScormForm);
$config['{DATABASE_PERSONAL}'] =(($singleDbForm && empty($dbUserForm)) ? $dbNameForm : $dbUserForm);
$config['{ROOT_WEB}'] = $urlForm;
$config['{ROOT_SYS}'] = $rootSys;
$config['{ROOT_SYS}'] = $root_sys;
$config['{URL_APPEND_PATH}'] = $urlAppendPath;
$config['{PLATFORM_LANGUAGE}'] = $languageForm;
$config['{SECURITY_KEY}'] = md5(uniqid(rand().time()));
@ -164,7 +160,7 @@ function load_main_database($installation_settings, $db_script = '') {
if (!empty($db_script)) {
$dokeos_main_sql_file_string = file_get_contents($db_script);
} else {
$dokeos_main_sql_file_string = file_get_contents(DOKEOS_MAIN_DATABASE_FILE);
$dokeos_main_sql_file_string = file_get_contents(SYSTEM_MAIN_DATABASE_FILE);
}
//replace symbolic parameters with user-specified values

@ -170,9 +170,9 @@ if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
//umask($old_umask); // This function is not thread-safe.
// Write the Dokeos config file
write_dokeos_config_file('../inc/conf/configuration.php');
write_system_config_file('../inc/conf/configuration.php');
// Write a distribution file with the config as a backup for the admin
write_dokeos_config_file('../inc/conf/configuration.dist.php');
write_system_config_file('../inc/conf/configuration.dist.php');
// Write a .htaccess file in the course repository
write_courses_htaccess_file($urlAppendPath);
copy($updatePath.'claroline/inc/conf/add_course.conf.php', $pathForm.'main/inc/conf/add_course.conf.php');

@ -202,10 +202,10 @@ if (defined('SYSTEM_INSTALLATION') || defined('DOKEOS_COURSE_UPDATE')) {
if (defined('SYSTEM_INSTALLATION')) {
// Write the Dokeos config file
write_dokeos_config_file($newPath.'main/inc/conf/configuration.php');
write_system_config_file($newPath.'main/inc/conf/configuration.php');
// Write a distribution file with the config as a backup for the admin
write_dokeos_config_file($newPath.'main/inc/conf/configuration.dist.php');
write_system_config_file($newPath.'main/inc/conf/configuration.dist.php');
// Write a .htaccess file in the course repository
write_courses_htaccess_file($urlAppendPath);

Loading…
Cancel
Save