1
0

FluxdServiceMod.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. /* $Id: FluxdServiceMod.php 2851 2007-04-09 17:17:30Z b4rt $ */
  3. /*******************************************************************************
  4. LICENSE
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License (GPL)
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. To read the license please visit http://www.gnu.org/copyleft/gpl.html
  14. *******************************************************************************/
  15. // states
  16. define('FLUXDMOD_STATE_NULL', 0); // null
  17. define('FLUXDMOD_STATE_RUNNING', 1); // running
  18. define('FLUXDMOD_STATE_ERROR', -1); // error
  19. // base class for a Fluxd-Service-module
  20. class FluxdServiceMod
  21. {
  22. // public fields
  23. // module-name
  24. var $moduleName = "";
  25. // state
  26. var $state = FLUXDMOD_STATE_NULL;
  27. // messages-array
  28. var $messages = array();
  29. // modstate
  30. var $modstate = FLUXDMOD_STATE_NULL;
  31. // =========================================================================
  32. // public static methods
  33. // =========================================================================
  34. /**
  35. * accessor for singleton
  36. *
  37. * @return FluxdServiceMod
  38. */
  39. function getInstance() {}
  40. /**
  41. * initialize FluxdServiceMod.
  42. */
  43. function initialize() {}
  44. /**
  45. * getState
  46. *
  47. * @return state
  48. */
  49. function getState() {}
  50. /**
  51. * getMessages
  52. *
  53. * @return array
  54. */
  55. function getMessages() {}
  56. /**
  57. * getModState
  58. *
  59. * @return state
  60. */
  61. function getModState() {}
  62. /**
  63. * isRunning
  64. *
  65. * @return boolean
  66. */
  67. function isRunning() {}
  68. /**
  69. * initialize a Fluxd-Service-mod.
  70. *
  71. * @param $type
  72. */
  73. function initializeServiceMod($type) {
  74. global $cfg;
  75. if (in_array($type, $cfg['fluxdServiceModList'])) {
  76. require_once('inc/classes/FluxdServiceMod.'.$type.'.php');
  77. eval('Fluxd'.$type.'::initialize();');
  78. }
  79. }
  80. // =========================================================================
  81. // ctor
  82. // =========================================================================
  83. /**
  84. * ctor
  85. */
  86. function FluxdServiceMod() {
  87. die('base class -- dont do this');
  88. }
  89. // =========================================================================
  90. // public methods
  91. // =========================================================================
  92. /**
  93. * initialize the FluxdServiceMod.
  94. */
  95. function instance_initialize() {
  96. // modstate-init
  97. $this->modstate = Fluxd::modState($this->moduleName);
  98. }
  99. }
  100. ?>