XMLDB/log.php
Chouchen 69b9eb42e2 More SQL command (drop table, drop database)
delete, select & insert upgraded 
More utility function (node to array, arrayToNode)
XMLDB special move command
PHP Unit Test
2010-10-11 14:03:38 +00:00

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 );
}
}