khanat-opennel-code/code/web/app/app_achievements/_AchWebParser/class/Logfile_class.php
SirCotare 9283736c91 #1470 This is a huge update. It contains all changes we made to the system on the
official ryzom servers. I removed non open source content though. So this version
is running on live servers and works!

--HG--
branch : gsoc2012-achievements
2012-12-10 15:07:13 +01:00

44 lines
No EOL
787 B
PHP

<?php
/*
* Logging, logging, logging....
*/
class Logfile {
private $logfile;
function Logfile($f = false) {
global $CONF,$MY_PATH;
$this->logfile = false;
if($f != false) {
$this->logfile = fopen($MY_PATH.$CONF['logfile'].'.'.date("Ymd",time()).'.txt','a+');
#echo "kk";
}
}
function logf($t,$nl = true) {
$this->write("[".date("H:i:s")."] ".$t);
if($nl == true) {
$this->write("\n");
}
}
function logi($t,$nl = true) {
#echo $t;
$this->write("[".date("H:i:s")."] > ".$t);
if($nl == true) {
$this->write("\n");
}
}
function write($txt) {
#echo $txt;
fwrite($this->logfile,$txt);
}
function close() {
fclose($this->logfile);
#echo "ii";
}
}
?>