setPath($path);
}
/** Set logger path
*
* @param String path to writeable folder
*/
public function setPath($path) {
$this->path = $path;
}
/** Get current logger path
* @return String current logger path
*/
public function getPath() {
return $this->path;
}
/** Write data to log, if logger path is set
*
* @param String input string
*/
public function write($str) {
$path = $this->getPath();
if(!empty($path)) {
if(is_dir($path)) {
$str = "[ ".date("d/m/Y H:i:s")." ] ".$str."\n";
$fileWriter = @file_put_contents($path."wookie_php.0.log", $str, FILE_APPEND);
if(!$fileWriter) {
echo "Wookie PHP: Writing to log failed, check permissions/path";
}
} else {
echo "Wookie PHP: Path is not a directory";
}
}
}
}
?>