From 155cf6aeea9ba7ecbc39face6442d3ce1b03ad8e Mon Sep 17 00:00:00 2001 From: Nils Schwabe Date: Wed, 4 Jun 2014 14:27:03 +0200 Subject: Add webinterface with functionallity --- management-interface/lib/log.php | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 management-interface/lib/log.php (limited to 'management-interface/lib/log.php') diff --git a/management-interface/lib/log.php b/management-interface/lib/log.php new file mode 100644 index 0000000..7ec78c0 --- /dev/null +++ b/management-interface/lib/log.php @@ -0,0 +1,60 @@ +write( + $this->file, + date($format). + (isset($_SERVER['REMOTE_ADDR'])? + (' ['.$_SERVER['REMOTE_ADDR'].']'):'').' '. + trim($text).PHP_EOL, + TRUE + ); + } + + /** + * Erase log + * @return NULL + **/ + function erase() { + @unlink($this->file); + } + + /** + * Instantiate class + * @param $file string + **/ + function __construct($file) { + $fw=Base::instance(); + if (!is_dir($dir=$fw->get('LOGS'))) + mkdir($dir,Base::MODE,TRUE); + $this->file=$dir.$file; + } + +} -- cgit v1.2.3-55-g7522