#4694 add feedback during installation

skala
Laurent Opprecht 14 years ago
parent 21919300de
commit f4d1e63a62
  1. 71
      main/inc/lib/log.class.php
  2. 3
      main/install/update-db-1.6.x-1.8.0.inc.php
  3. 4
      main/install/update-db-1.8.0-1.8.2.inc.php
  4. 4
      main/install/update-db-1.8.2-1.8.3.inc.php
  5. 4
      main/install/update-db-1.8.3-1.8.4.inc.php
  6. 4
      main/install/update-db-1.8.4-1.8.5.inc.php
  7. 4
      main/install/update-db-1.8.5-1.8.6.inc.php
  8. 4
      main/install/update-db-1.8.6-1.8.6.1.inc.php
  9. 4
      main/install/update-db-1.8.6.1-1.8.6.2.inc.php
  10. 4
      main/install/update-db-1.8.6.2-1.8.7.inc.php
  11. 4
      main/install/update-db-1.8.7-1.8.8.inc.php
  12. 4
      main/install/update-db-1.8.8-1.9.0.inc.php
  13. 2
      main/install/update-db-scorm-1.6.x-1.8.0.inc.php
  14. 2
      main/install/update-files-1.6.x-1.8.0.inc.php
  15. 2
      main/install/update-files-1.8.3-1.8.4.inc.php
  16. 2
      main/install/update-files-1.8.4-1.8.5.inc.php
  17. 2
      main/install/update-files-1.8.5-1.8.6.inc.php
  18. 2
      main/install/update-files-1.8.6-1.8.6.1.inc.php
  19. 2
      main/install/update-files-1.8.6.1-1.8.6.2.inc.php
  20. 3
      main/install/update-files-1.8.6.2-1.8.7.inc.php
  21. 2
      main/install/update-files-1.8.7-1.8.8.inc.php
  22. 2
      main/install/update-files-1.8.8-1.9.0.inc.php

@ -2,6 +2,8 @@
use Monolog\Logger;
Log::register_autoload();
/**
* Description of log
*
@ -11,7 +13,7 @@ use Monolog\Logger;
class Log
{
private static function register_autoload()
public static function register_autoload()
{
static $has_run = false;
if ($has_run) {
@ -29,23 +31,56 @@ class Log
$has_run = true;
}
/**
*
* @return \Monolog\Logger
*/
public static function default_logger()
{
$name = 'chamilo';
$result = new Logger($name);
$handler = new Monolog\Handler\StreamHandler('php://stderr');
$handler->setFormatter(new Monolog\Formatter\LineFormatter('[%datetime%] [%level_name%] [%channel%] %message%' . PHP_EOL, 'Y-m-d H:i:s')); //%context% %extra%
$result->pushHandler($handler);
return $result;
}
private static $logger = null;
/**
*
* @return \Monolog\Logger
*/
public static function logger()
{
static $result = null;
if (empty($result)) {
self::register_autoload();
$name = 'chamilo';
$result = new Logger($name);
$handler = new Monolog\Handler\StreamHandler('php://stderr');
$handler->setFormatter(new Monolog\Formatter\LineFormatter('[%datetime%] [%level_name%] [%channel%]: %message%' . PHP_EOL, 'Y-m-d H:i:s')); //%context% %extra%
$result->pushHandler($handler);
//$result->pushProcessor(new \Monolog\Processor\WebProcessor());
if (empty(self::$logger)) {
self::$logger = self::default_logger();
}
return $result;
return self::$logger;
}
public static function set_logger($value)
{
self::$logger = $value;
}
public static function write($level, $message, $context = array())
{
/*
* Note that the same could be done with a monolog processor.
*/
$trace = debug_backtrace();
array_shift($trace);
$trace = reset($trace);
$file = $trace['file'];
$root = realpath(api_get_path(SYS_PATH));
$file = str_replace($root, '', $file);
$file = trim($file, DIRECTORY_SEPARATOR);
$line = $trace['line'];
$message = "[$file:$line] " . $message;
self::logger()->addRecord($level, $message, $context);
}
/**
@ -59,7 +94,7 @@ class Log
*/
public static function debug($message, array $context = array())
{
return self::logger()->debug($message, $context);
return self::write(Logger::DEBUG, $message, $context);
}
/**
@ -73,7 +108,7 @@ class Log
*/
public static function info($message, array $context = array())
{
return self::logger()->info($message, $context);
return self::write(Logger::INFO, self::message($message), $context);
}
/**
@ -87,7 +122,7 @@ class Log
*/
public static function notice($message, array $context = array())
{
return self::logger()->notice($message, $context);
return self::write(Logger::INFO, $message, $context);
}
/**
@ -101,7 +136,7 @@ class Log
*/
public static function warning($message, array $context = array())
{
return self::logger()->warn($message, $context);
return self::write(Logger::WARNING, $message, $context);
}
/**
@ -115,7 +150,7 @@ class Log
*/
public static function error($message, array $context = array())
{
return self::logger()->err($message, $context);
return self::write(Logger::ERROR, $message, $context);
}
/**
@ -129,7 +164,7 @@ class Log
*/
public static function crit($message, array $context = array())
{
return self::logger()->crit($message, $context);
return self::write(Logger::CRITICAL, $message, $context);
}
/**
@ -143,7 +178,7 @@ class Log
*/
public static function alert($message, array $context = array())
{
return self::logger()->alert($message, $context);
return self::write(Logger::ALERT, $message, $context);
}
}

@ -18,7 +18,8 @@
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
// Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION')) {

@ -17,7 +17,7 @@
* - reorganise code into functions
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
// Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION')) {
@ -186,7 +186,7 @@ if (defined('SYSTEM_INSTALLATION')) {
if (!$singleDbForm) { // otherwise just use the main one
Database::select_db($row_course['db_name']);
}
Log::notice(basename(__FILE__) . ' - course ' . $row_course);
Log::notice('Course ' . $row_course);
foreach ($c_q_list as $query) {
if ($singleDbForm) {

@ -16,7 +16,7 @@
* - reorganise code into functions
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
// Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION')) {
@ -184,7 +184,7 @@ if (defined('SYSTEM_INSTALLATION')) {
if (!$singleDbForm) { //otherwise just use the main one
Database::select_db($row_course['db_name']);
}
Log::notice(basename(__FILE__) . ' - course ' . $row_course);
Log::notice('Course ' . $row_course);
foreach ($c_q_list as $query) {
if ($singleDbForm) { //otherwise just use the main one

@ -16,7 +16,7 @@
* - reorganise code into functions
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
// Check if we come from index.php or update_courses.php - otherwise display error msg
if (defined('SYSTEM_INSTALLATION')) {
@ -184,7 +184,7 @@ if (defined('SYSTEM_INSTALLATION')) {
if (!$singleDbForm) { //otherwise just use the main one
Database::select_db($row_course['db_name']);
}
Log::notice(basename(__FILE__) . ' - course ' . $row_course);
Log::notice('Course ' . $row_course);
foreach ($c_q_list as $query) {
if ($singleDbForm) {

@ -16,7 +16,7 @@
* - reorganise code into functions
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
$old_file_version = '1.8.4';
$new_file_version = '1.8.5';
@ -191,7 +191,7 @@ if (defined('SYSTEM_INSTALLATION')) {
if (!$singleDbForm) { //otherwise just use the main one
Database::select_db($row_course['db_name']);
}
Log::notice(basename(__FILE__) . ' - course ' . $row_course);
Log::notice('Course ' . $row_course);
foreach ($c_q_list as $query) {
if ($singleDbForm) {

@ -16,7 +16,7 @@
* - reorganise code into functions
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
$old_file_version = '1.8.5';
$new_file_version = '1.8.6';
@ -1102,7 +1102,7 @@ if (defined('SYSTEM_INSTALLATION')) {
if (!$singleDbForm) { //otherwise just use the main one
Database::select_db($row_course['db_name']);
}
Log::notice(basename(__FILE__) . ' - course ' . $row_course);
Log::notice('Course ' . $row_course);
foreach ($c_q_list as $query) {
if ($singleDbForm) { //otherwise just use the main one

@ -16,7 +16,7 @@
* - reorganise code into functions
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
$old_file_version = '1.8.6';
$new_file_version = '1.8.6.1';
@ -192,7 +192,7 @@ if (defined('SYSTEM_INSTALLATION')) {
if (!$singleDbForm) { //otherwise just use the main one
Database::select_db($row_course['db_name']);
}
Log::notice(basename(__FILE__) . ' - course ' . $row_course);
Log::notice('Course ' . $row_course);
foreach ($c_q_list as $query) {
if ($singleDbForm) {

@ -16,7 +16,7 @@
* - reorganise code into functions
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
$old_file_version = '1.8.6.1';
$new_file_version = '1.8.6.2';
@ -296,7 +296,7 @@ if (defined('SYSTEM_INSTALLATION')) {
if (!$singleDbForm) { //otherwise just use the main one
Database::select_db($row_course['db_name']);
}
Log::notice(basename(__FILE__) . ' - course ' . $row_course);
Log::notice('Course ' . $row_course);
foreach ($c_q_list as $query) {
if ($singleDbForm) {

@ -16,7 +16,7 @@
* - reorganise code into functions
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
$old_file_version = '1.8.6.2';
$new_file_version = '1.8.7';
@ -401,7 +401,7 @@ if (defined('SYSTEM_INSTALLATION')) {
if (!$singleDbForm) { // otherwise just use the main one
Database::select_db($row_course['db_name']);
}
Log::notice(basename(__FILE__) . ' - course ' . $row_course);
Log::notice('Course ' . $row_course);
foreach ($c_q_list as $query) {
if ($singleDbForm) {

@ -16,7 +16,7 @@
* - reorganise code into functions
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
$old_file_version = '1.8.7';
$new_file_version = '1.8.8';
@ -229,7 +229,7 @@ if (defined('SYSTEM_INSTALLATION')) {
if (!$singleDbForm) { // otherwise just use the main one
Database::select_db($row_course['db_name']);
}
Log::notice(basename(__FILE__) . ' - course ' . $row_course);
Log::notice('Course ' . $row_course);
foreach ($c_q_list as $query) {
if ($singleDbForm) {

@ -16,7 +16,7 @@
* - reorganise code into functions
* @todo use database library
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
$old_file_version = '1.8.8';
$new_file_version = '1.9.0';
@ -264,7 +264,7 @@ if (defined('SYSTEM_INSTALLATION')) {
if (!$singleDbForm) { // otherwise just use the main one
Database::select_db($row_course['db_name']);
}
Log::notice(basename(__FILE__) . ' - course ' . $row_course);
Log::notice('Course ' . $row_course);
foreach ($c_q_list as $query) {
if ($singleDbForm) {

@ -12,7 +12,7 @@
/**
* Include mandatory libraries
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php'; //check_name_exists()

@ -18,7 +18,7 @@
*
* @package chamilo.install
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
function insert_db($db_name, $folder_name, $text)
{

@ -17,7 +17,7 @@
* @package chamilo.install
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
if (defined('SYSTEM_INSTALLATION')) {

@ -17,7 +17,7 @@
* @package chamilo.install
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
if (defined('SYSTEM_INSTALLATION')) {

@ -18,7 +18,7 @@
* @package chamilo.install
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
if (defined('SYSTEM_INSTALLATION')) {

@ -17,7 +17,7 @@
* @package chamilo.install
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
if (defined('SYSTEM_INSTALLATION')) {

@ -12,7 +12,7 @@
* @package chamilo.install
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
if (defined('SYSTEM_INSTALLATION')) {

@ -11,8 +11,7 @@
* @package chamilo.install
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
if (defined('SYSTEM_INSTALLATION')) {

@ -11,7 +11,7 @@
* @package chamilo.install
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
if (defined('SYSTEM_INSTALLATION')) {

@ -11,7 +11,7 @@
* @package chamilo.install
*/
Log::notice("Starting " . basename(__FILE__));
Log::notice('Entering file');
if (defined('SYSTEM_INSTALLATION')) {

Loading…
Cancel
Save