]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - Classes/class-log.php
Works on some more
[irc/unrealircd/unrealircd-webpanel.git] / Classes / class-log.php
1 <?php
2
3 if (!defined('UPATH'))
4 die("Access denied");
5
6
7 class Log
8 {
9 function __construct()
10 {
11
12 if (!is_dir("log/"))
13 mkdir("log/");
14 $filename = "log/".date("Y-m-d")."log";
15 if (!file_exists($filename))
16 {
17 $open = fopen($filename, 'w');
18 $close = fclose($open);
19 }
20 }
21 function it(...$string)
22 {
23 foreach($string as $str)
24 {
25 if (UNREALIRCD_DEBUG) {
26 highlight_string(var_export($str, true));
27 }
28 }
29 }
30 }
31
32 function do_log(...$strings)
33 {
34 $log = new Log();
35 $log->it($strings);
36 }
37
38 function get_date($year, $month, $day, $hour, $minute)
39 {
40 return "$year-$month-$day" . "T$hour-$minute" . "Z";
41 }