1
0

FluxdServiceMod.Maintenance.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /* $Id: FluxdServiceMod.Maintenance.php 1915 2006-12-16 11:51:16Z 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. // class for the Fluxd-Service-module Maintenance
  16. class FluxdMaintenance extends FluxdServiceMod
  17. {
  18. // =========================================================================
  19. // public static methods
  20. // =========================================================================
  21. /**
  22. * accessor for singleton
  23. *
  24. * @return FluxdMaintenance
  25. */
  26. function getInstance() {
  27. global $instanceFluxdMaintenance;
  28. // initialize if needed
  29. if (!isset($instanceFluxdMaintenance))
  30. FluxdMaintenance::initialize();
  31. return $instanceFluxdMaintenance;
  32. }
  33. /**
  34. * initialize FluxdMaintenance.
  35. */
  36. function initialize() {
  37. global $instanceFluxdMaintenance;
  38. // create instance
  39. if (!isset($instanceFluxdMaintenance))
  40. $instanceFluxdMaintenance = new FluxdMaintenance();
  41. }
  42. /**
  43. * getState
  44. *
  45. * @return state
  46. */
  47. function getState() {
  48. global $instanceFluxdMaintenance;
  49. return (isset($instanceFluxdMaintenance))
  50. ? $instanceFluxdMaintenance->state
  51. : FLUXDMOD_STATE_NULL;
  52. }
  53. /**
  54. * getMessages
  55. *
  56. * @return array
  57. */
  58. function getMessages() {
  59. global $instanceFluxdMaintenance;
  60. return (isset($instanceFluxdMaintenance))
  61. ? $instanceFluxdMaintenance->messages
  62. : array();
  63. }
  64. /**
  65. * getModState
  66. *
  67. * @return state
  68. */
  69. function getModState() {
  70. global $instanceFluxdMaintenance;
  71. return (isset($instanceFluxdMaintenance))
  72. ? $instanceFluxdMaintenance->modstate
  73. : FLUXDMOD_STATE_NULL;
  74. }
  75. /**
  76. * isRunning
  77. *
  78. * @return boolean
  79. */
  80. function isRunning() {
  81. global $instanceFluxdMaintenance;
  82. return (isset($instanceFluxdMaintenance))
  83. ? ($instanceFluxdMaintenance->modstate == FLUXDMOD_STATE_RUNNING)
  84. : false;
  85. }
  86. // =========================================================================
  87. // ctor
  88. // =========================================================================
  89. /**
  90. * ctor
  91. */
  92. function FluxdMaintenance() {
  93. // name
  94. $this->moduleName = "Maintenance";
  95. // initialize
  96. $this->instance_initialize();
  97. }
  98. }
  99. ?>