Abstract.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. /**
  3. * Phergie
  4. *
  5. * PHP version 5
  6. *
  7. * LICENSE
  8. *
  9. * This source file is subject to the new BSD license that is bundled
  10. * with this package in the file LICENSE.
  11. * It is also available through the world-wide-web at this URL:
  12. * http://phergie.org/license
  13. *
  14. * @category Phergie
  15. * @package Phergie
  16. * @author Phergie Development Team <team@phergie.org>
  17. * @copyright 2008-2010 Phergie Development Team (http://phergie.org)
  18. * @license http://phergie.org/license New BSD License
  19. * @link http://pear.phergie.org/package/Phergie
  20. */
  21. /**
  22. * Base class for end-user interfaces.
  23. *
  24. * @category Phergie
  25. * @package Phergie
  26. * @author Phergie Development Team <team@phergie.org>
  27. * @license http://phergie.org/license New BSD License
  28. * @link http://pear.phergie.org/package/Phergie
  29. */
  30. abstract class Phergie_Ui_Abstract
  31. {
  32. /**
  33. * Handler for when a server connection is attempted.
  34. *
  35. * @param string $host Server hostname
  36. *
  37. * @return void
  38. */
  39. public function onConnect($host)
  40. {
  41. }
  42. /**
  43. * Handler for when an attempt is made to load a plugin.
  44. *
  45. * @param string $plugin Short name of the plugin
  46. *
  47. * @return void
  48. */
  49. public function onPluginLoad($plugin)
  50. {
  51. }
  52. /**
  53. * Handler for when a plugin fails to load.
  54. *
  55. * @param string $plugin Short name of the plugin
  56. * @param string $message Message describing the reason for the failure
  57. *
  58. * @return void
  59. */
  60. public function onPluginFailure($plugin, $message)
  61. {
  62. }
  63. /**
  64. * Handler for when the bot receives an IRC event.
  65. *
  66. * @param Phergie_Event_Abstract $event Received event
  67. * @param Phergie_Connection $connection Connection on which the event
  68. * was received
  69. *
  70. * @return void
  71. */
  72. public function onEvent(Phergie_Event_Abstract $event,
  73. Phergie_Connection $connection
  74. ) {
  75. }
  76. /**
  77. * Handler for when the bot sends a command to a server.
  78. *
  79. * @param Phergie_Event_Command $event Event representing the command
  80. * being sent
  81. * @param Phergie_Connection $connection Connection on which the command
  82. * is being sent
  83. *
  84. * @return void
  85. */
  86. public function onCommand(Phergie_Event_Command $event,
  87. Phergie_Connection $connection
  88. ) {
  89. }
  90. /**
  91. * Handler for when the bot terminates a connection to a server.
  92. *
  93. * @param Phergie_Connection $connection Terminated connection
  94. *
  95. * @return void
  96. */
  97. public function onQuit(Phergie_Connection $connection)
  98. {
  99. }
  100. /**
  101. * Handler for when the bot shuts down after terminating all server
  102. * connections.
  103. *
  104. * @return void
  105. */
  106. public function onShutdown()
  107. {
  108. }
  109. }