5 * Send out webhook callbacks when something happens
9 protected $notificators = array();
11 public function __construct()
13 $this->loadNotificators();
16 protected function loadNotificators()
18 foreach ($GLOBALS['phorkie']['cfg']['notificator'] as $type => $config) {
19 $class = '\\phorkie\\Notificator_' . ucfirst($type);
20 $this->notificators[] = new $class($config);
25 * A repository has been created
27 public function create(Repository $repo)
29 $this->send('create', $repo);
33 * A repository has been modified
35 public function edit(Repository $repo)
37 $this->send('edit', $repo);
41 * A repository has been deleted
43 public function delete(Repository $repo)
45 $this->send('delete', $repo);
49 * Call all notificator plugins
51 protected function send($event, Repository $repo)
53 foreach ($this->notificators as $notificator) {
54 $notificator->send($event, $repo);