Hooks.php 535 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Tools;
  3. class Hooks
  4. {
  5. private $context;
  6. public function __construct($context)
  7. {
  8. $this->context = $context;
  9. }
  10. public function register($module, $hookName)
  11. {
  12. if (!\Tools\ModuleManager::isInstalling())
  13. throw new \Exception("You can only register hooks while installing");
  14. //TODO
  15. }
  16. public function trigger($hookName)
  17. {
  18. echo "Triggering hook `{$hookName}'";
  19. //TODO
  20. }
  21. public function loadHooks($hookEntities)
  22. {
  23. }
  24. }