From 66bd36e98686153c0b529a537eb9e6eae765145a Mon Sep 17 00:00:00 2001 From: Julio Date: Thu, 22 Oct 2015 15:39:13 +0200 Subject: [PATCH] Adding error_log --- main/install/index.php | 8 ++++++- main/install/install.lib.php | 10 ++++++--- main/install/update-configuration.inc.php | 2 ++ .../install/update-files-1.9.0-1.10.0.inc.php | 21 +++++++++++++++++-- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/main/install/index.php b/main/install/index.php index 93adfeadbd..ace924ec22 100755 --- a/main/install/index.php +++ b/main/install/index.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 diff --git a/main/install/install.lib.php b/main/install/install.lib.php index b55527d227..b332b6203d 100755 --- a/main/install/install.lib.php +++ b/main/install/install.lib.php @@ -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(); diff --git a/main/install/update-configuration.inc.php b/main/install/update-configuration.inc.php index 02d3b0e6d9..cd7f859b8d 100755 --- a/main/install/update-configuration.inc.php +++ b/main/install/update-configuration.inc.php @@ -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__; } diff --git a/main/install/update-files-1.9.0-1.10.0.inc.php b/main/install/update-files-1.9.0-1.10.0.inc.php index f647185bd3..00e202bcf7 100644 --- a/main/install/update-files-1.9.0-1.10.0.inc.php +++ b/main/install/update-files-1.9.0-1.10.0.inc.php @@ -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');