Adding error_log

1.10.x
Julio 10 years ago
parent 50c4d7021a
commit 66bd36e986
  1. 8
      main/install/index.php
  2. 10
      main/install/install.lib.php
  3. 2
      main/install/update-configuration.inc.php
  4. 21
      main/install/update-files-1.9.0-1.10.0.inc.php

@ -36,6 +36,7 @@ ob_implicit_flush(true);
session_start();
require_once api_get_path(LIBRARY_PATH).'database.constants.inc.php';
require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
require_once api_get_path(LIBRARY_PATH).'banner.lib.php';
require_once 'install.lib.php';
// The function api_get_setting() might be called within the installation scripts.
@ -696,7 +697,7 @@ if (@$_POST['step2']) {
$perm = api_get_permissions_for_new_directories();
$perm_file = api_get_permissions_for_new_files();
error_log('Starting migration process from '.$my_old_version.' ('.time().')');
error_log('Starting migration process from '.$my_old_version.' ('.date('Y-m-d H:i:s').')');
switch ($my_old_version) {
case '1.9.0':
@ -751,6 +752,8 @@ if (@$_POST['step2']) {
'portfolio.conf.php'
);
error_log('Copy conf files');
foreach ($configurationFiles as $file) {
if (file_exists(api_get_path(SYS_CODE_PATH) . 'inc/conf/'.$file)) {
copy(
@ -759,6 +762,8 @@ if (@$_POST['step2']) {
);
}
}
error_log('Finish upgrade process! ('.date('Y-m-d H:i:s').')');
} else {
error_log('There was an error during running migrations. Check error.log');
}
@ -820,6 +825,7 @@ if (@$_POST['step2']) {
include 'install_files.inc.php';
}
display_after_install_message($installType);
// Hide the "please wait" message sent previously

@ -2064,7 +2064,6 @@ function fixIds(EntityManager $em)
if ($debug) {
error_log('fixIds');
error_log('Update tools');
}
// Create temporary indexes to increase speed of the following operations
@ -2491,7 +2490,7 @@ function fixIds(EntityManager $em)
foreach ($fields as $field) {
if ($debug) {
error_log("Loading field $field");
error_log("Loading field: ".$field['field_variable']);
}
$originalId = $field['id'];
$extraField = new ExtraField();
@ -2542,7 +2541,6 @@ function fixIds(EntityManager $em)
}
if (!empty($optionTable)) {
$sql = "SELECT * FROM $optionTable WHERE field_id = $originalId ";
$result = $connection->query($sql);
$options = $result->fetchAll();
@ -2561,9 +2559,15 @@ function fixIds(EntityManager $em)
$sql = "SELECT * FROM $valueTable WHERE field_id = $originalId ";
$result = $connection->query($sql);
$values = $result->fetchAll();
if ($debug) {
error_log("Fetch all values for field");
}
}
if (!empty($values)) {
if ($debug) {
error_log("Saving field value in new table");
}
foreach ($values as $value) {
if (isset($value[$handlerId])) {
$extraFieldValue = new ExtraFieldValues();

@ -71,6 +71,8 @@ if (defined('SYSTEM_INSTALLATION')) {
}
fwrite($fh, '?>');
fclose($fh);
error_log("configuration.php file updated.");
} else {
echo 'You are not allowed here !'. __FILE__;
}

@ -13,7 +13,9 @@ use Symfony\Component\Finder\Finder;
* current configuration file.
* @package chamilo.install
*/
error_log('Entering file');
error_log("Starting " . basename(__FILE__));
global $debug;
if (defined('SYSTEM_INSTALLATION')) {
// Changes for 1.10.x
@ -151,6 +153,10 @@ if (defined('SYSTEM_INSTALLATION')) {
}
}
if ($debug) {
error_log('Cleaning folders');
}
// Remove the "main/conference/" directory that wasn't used since years long
// past - see rrmdir function declared below
@rrmdir(api_get_path(SYS_CODE_PATH).'conference');
@ -174,14 +180,22 @@ if (defined('SYSTEM_INSTALLATION')) {
api_get_path(SYS_PATH).'home' => api_get_path(SYS_APP_PATH)
];
if ($debug) {
error_log('Moving folders');
}
foreach ($movePathList as $origin => $destination) {
if (is_dir($origin)) {
move($origin, $destination);
error_log("$origin to $destination");
}
}
// Delete all "courses/ABC/index.php" files.
if ($debug) {
error_log('Deleting old courses/ABC/index.php files');
}
$finder = new Finder();
$courseDir = api_get_path(SYS_APP_PATH).'courses';
@ -210,6 +224,9 @@ if (defined('SYSTEM_INSTALLATION')) {
}
}
if ($debug) {
error_log('Remove archive folder');
}
// Remove archive
@rrmdir(api_get_path(SYS_PATH).'archive');

Loading…
Cancel
Save