Config.php 765 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\Core\Hook;
  3. use ThurData\Servers\KerioEmail\Core\FileReader\Reader;
  4. use ThurData\Servers\KerioEmail\Core\ModuleConstants;
  5. /**
  6. * Description of Config
  7. *
  8. * @author Rafał Ossowski <rafal.os@thurdata.com>
  9. */
  10. class Config
  11. {
  12. /**
  13. * @var type
  14. */
  15. protected $data = [];
  16. public function __construct()
  17. {
  18. $this->data = Reader::read(ModuleConstants::getDevConfigDir() . DS . 'hooks.yml')->get('name', []);
  19. }
  20. /**
  21. * @param string $name
  22. * @return boolean
  23. */
  24. public function checkHook($name)
  25. {
  26. if (isset($this->data) && count($this->data) != 0)
  27. {
  28. return (bool) array_get($this->data, $name, true);
  29. }
  30. return true;
  31. }
  32. }