All the libraries, when it is required, now are using the message helper

This commit is contained in:
bison-paolo
2016-10-07 14:13:58 +02:00
parent 1fed18dd9b
commit 3588047989
7 changed files with 155 additions and 246 deletions
+20 -20
View File
@@ -1,20 +1,20 @@
<?php
if (! defined("BASEPATH")) exit("No direct script access allowed");
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Utility class to be used in the database migration process
* Library usefull for logging!
*/
class LogLib
{
const DEBUG = "debug";
const ERROR = "error";
const INFO = "info";
const DEBUG = 'debug';
const ERROR = 'error';
const INFO = 'info';
const CALLER_PREFIX = "[";
const CALLER_POSTFIX = "]";
const CLASS_POSTFIX = "->";
const LINE_SEPARATOR = ":";
const CALLER_PREFIX = '[';
const CALLER_POSTFIX = ']';
const CLASS_POSTFIX = '->';
const LINE_SEPARATOR = ':';
/**
* Object initialization
@@ -25,12 +25,12 @@ class LogLib
{
$formatted = LogLib::CALLER_PREFIX;
if (!is_null($class) && $class != "")
if (!is_null($class) && $class != '')
{
$formatted .= $class . LogLib::CLASS_POSTFIX;
}
$formatted .= $function . LogLib::LINE_SEPARATOR . $line . LogLib::CALLER_POSTFIX . " ";
$formatted .= $function . LogLib::LINE_SEPARATOR . $line . LogLib::CALLER_POSTFIX . ' ';
return $formatted;
}
@@ -40,23 +40,23 @@ class LogLib
$classIndex = 3;
$functionIndex = 3;
$lineIndex = 2;
$class = "";
$function = "";
$line = "";
$class = '';
$function = '';
$line = '';
if (isset(debug_backtrace()[$classIndex]["class"]) && debug_backtrace()[$classIndex]["class"] != "")
if (isset(debug_backtrace()[$classIndex]['class']) && debug_backtrace()[$classIndex]['class'] != '')
{
$class = debug_backtrace()[$classIndex]["class"];
$class = debug_backtrace()[$classIndex]['class'];
}
if (isset(debug_backtrace()[$functionIndex]["function"]) && debug_backtrace()[$functionIndex]["function"] != "")
if (isset(debug_backtrace()[$functionIndex]['function']) && debug_backtrace()[$functionIndex]['function'] != '')
{
$function = debug_backtrace()[$functionIndex]["function"];
$function = debug_backtrace()[$functionIndex]['function'];
}
if (isset(debug_backtrace()[$lineIndex]["line"]) && debug_backtrace()[$lineIndex]["line"] != "")
if (isset(debug_backtrace()[$lineIndex]['line']) && debug_backtrace()[$lineIndex]['line'] != '')
{
$line = debug_backtrace()[$lineIndex]["line"];
$line = debug_backtrace()[$lineIndex]['line'];
}
return $this->format($class, $function, $line);