PageRenderTime 48ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/Helios Engine/helios/ioengines/log.php

https://code.google.com/p/prjtest00/
PHP | 51 lines | 22 code | 2 blank | 27 comment | 7 complexity | 416d2eab01164b992e98e0293ce3d3fe MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0
  1. <?php
  2. ############################################################################
  3. # Copyright (C) 2007 by Arturo Mann #
  4. # arturo.mann@gmail.com #
  5. # #
  6. # This program is free software; you can redistribute it and#or modify #
  7. # it under the terms of the GNU General Public License as published by #
  8. # the Free Software Foundation; either version 2 of the License, or #
  9. # (at your option) any later version. #
  10. # #
  11. # This program is distributed in the hope that it will be useful, #
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of #
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  14. # GNU General Public License for more details. #
  15. # #
  16. # You should have received a copy of the GNU General Public License #
  17. # along with this program; if not, write to the #
  18. # Free Software Foundation, Inc., #
  19. # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
  20. ############################################################################
  21. // HeliosEngine Logger IOEngine loader
  22. class SakuraLogCore {
  23. // Log sink holder
  24. private $logs = NULL;
  25. // Module:
  26. private $module = NULL;
  27. public function __construct($Config) {
  28. if ($siteid < 0) {
  29. trigger_error("Logger: No SiteID Specified.",E_USER_ERROR);
  30. }
  31. // Initialise configuration:
  32. require "config/config.inc.php";
  33. $this->module = $cfg["servers"][$Config]["logconfig"]["output"];
  34. // Open modules:
  35. if ($this->module != NULL){
  36. require "ioengines/logger/".$this->module."/init.php";
  37. }}
  38. // Log!
  39. public function log($target,$message) {
  40. // Open module:
  41. if ($this->module != NULL){
  42. require "ioengines/logger/".$this->module."/write.php";
  43. }}
  44. // Dissamble class
  45. public function __destruct() {
  46. if ($this->module != NULL){
  47. require "ioengines/logger/".$this->module."/close.php";
  48. }}
  49. }