/Helios Engine/helios/ioengines/log.php
PHP | 51 lines | 22 code | 2 blank | 27 comment | 7 complexity | 416d2eab01164b992e98e0293ce3d3fe MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0
- <?php
- ############################################################################
- # Copyright (C) 2007 by Arturo Mann #
- # arturo.mann@gmail.com #
- # #
- # This program is free software; you can redistribute it and#or modify #
- # it under the terms of the GNU General Public License as published by #
- # the Free Software Foundation; either version 2 of the License, or #
- # (at your option) any later version. #
- # #
- # This program is distributed in the hope that it will be useful, #
- # but WITHOUT ANY WARRANTY; without even the implied warranty of #
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
- # GNU General Public License for more details. #
- # #
- # You should have received a copy of the GNU General Public License #
- # along with this program; if not, write to the #
- # Free Software Foundation, Inc., #
- # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
- ############################################################################
- // HeliosEngine Logger IOEngine loader
- class SakuraLogCore {
- // Log sink holder
- private $logs = NULL;
- // Module:
- private $module = NULL;
- public function __construct($Config) {
- if ($siteid < 0) {
- trigger_error("Logger: No SiteID Specified.",E_USER_ERROR);
- }
- // Initialise configuration:
- require "config/config.inc.php";
- $this->module = $cfg["servers"][$Config]["logconfig"]["output"];
- // Open modules:
- if ($this->module != NULL){
- require "ioengines/logger/".$this->module."/init.php";
- }}
- // Log!
- public function log($target,$message) {
- // Open module:
- if ($this->module != NULL){
- require "ioengines/logger/".$this->module."/write.php";
- }}
- // Dissamble class
- public function __destruct() {
- if ($this->module != NULL){
- require "ioengines/logger/".$this->module."/close.php";
- }}
- }