Hooker.php 708 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Event dispatcher
  4. *
  5. * @package Requests
  6. * @subpackage Utilities
  7. */
  8. /**
  9. * Event dispatcher
  10. *
  11. * @package Requests
  12. * @subpackage Utilities
  13. */
  14. interface Requests_Hooker {
  15. /**
  16. * Register a callback for a hook
  17. *
  18. * @param string $hook Hook name
  19. * @param callback $callback Function/method to call on event
  20. * @param int $priority Priority number. <0 is executed earlier, >0 is executed later
  21. */
  22. public function register($hook, $callback, $priority = 0);
  23. /**
  24. * Dispatch a message
  25. *
  26. * @param string $hook Hook name
  27. * @param array $parameters Parameters to pass to callbacks
  28. * @return boolean Successfulness
  29. */
  30. public function dispatch($hook, $parameters = array());
  31. }