69b9eb42e2
delete, select & insert upgraded More utility function (node to array, arrayToNode) XMLDB special move command PHP Unit Test
24 lines
489 B
PHP
24 lines
489 B
PHP
<?
|
|
class Log {
|
|
|
|
protected $logfile;
|
|
|
|
function __construct($filename) {
|
|
$file = $filename;
|
|
$this->logfile = fopen($file, 'a+');
|
|
$this->message('Starting log');
|
|
}
|
|
|
|
function message($message) {
|
|
$message = '['. date("Y-m-d / H:i:s") . ']'.' - '.$message;
|
|
$message .= "\n";
|
|
return fwrite( $this->logfile, $message );
|
|
}
|
|
|
|
function __destruct(){
|
|
$this->message('Finishing log');
|
|
return fclose( $this->logfile );
|
|
}
|
|
}
|
|
|