This object stores logs

uses implements the singleton pattern
uses the exception handler
package OWR
used_by \OWR\CLI\Controller
used_by \OWR\Model\News
used_by \OWR\Model\Streams
used_by \OWR\Controller

 Methods

Cloning is denied This function can NOT be overloaded

__clone() 
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::__clone()

Destructor Writes the logs if not already done and if not empty

__destruct() 
author Pierre-Alain Mignot
access public

Executed when an object is unserialized We register the new object

__wakeUp() 
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::__wakeUp()

Displays CLI log file

getCLILogs() : string
author Pierre-Alain Mignot
access public

Returns

stringthe content of CLI log file

Returns all logged messages from $this->_logs and empty it

getLogs() : array
author Pierre-Alain Mignot
access public

Returns

arraythe logs

Checks if we got logs

hasLogs() : boolean
author Pierre-Alain Mignot
access public

Returns

booleantrue if logs are not empty

Instance getter This function can NOT be overloaded

iGet() : mixed
InheritedStatic
access public
static
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::iGet()

Returns

mixedthe instance

Stores log message in $this->_logs

log(string $msg, int $errcode) 
author Pierre-Alain Mignot
access public

Parameters

$msg

string

the message to log

$errcode

int

the error code

Register function This function is called when an object is unserialized and is used to register the instance of the object This function can NOT be overloaded

register(mixed $instance) 
InheritedStatic
access public
static
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::register()

Parameters

$instance

mixed

the instance to register

Writes the logs If in CLI mode, we will write the logs into HOME_PATH/logs/cli.log else in default php error log file

writeLogs(boolean $write) : boolean
author Pierre-Alain Mignot
access public

Parameters

$write

boolean

force writting of the logs into the log file

Returns

booleantrue on success

Constructor

__construct() 
Inherited
access protected
inherited_from \OWR\Singleton::__construct()

 Properties

 

the logs

$_logs : array
access private
 

store instancied objects

$_instances : array
Inherited
access private
static
inherited_from \OWR\Singleton::$$_instances