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