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
This commit is contained in:
23
log.php
Normal file
23
log.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user