-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlugin.php
More file actions
43 lines (37 loc) · 1013 Bytes
/
Plugin.php
File metadata and controls
43 lines (37 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Bethropolis\PluginSystem;
use Bethropolis\PluginSystem\System;
use Bethropolis\PluginSystem\Error;
abstract class Plugin
{
protected $name = "unnamed plugin";
protected $version;
protected $author;
protected $description;
public function getInfo()
{
return array(
'name' => $this->name,
'version' => $this->version,
'author' => $this->author,
'description' => $this->description
);
}
public function initialize(){}
public function linkHook($hook, $callback = null)
{
System::linkPluginToHook($hook, $callback);
}
public function linkEvent($event, $callback = null)
{
System::addAction($event, $callback);
}
public function error($errorMessage, $errorLevel = "ERROR")
{
Error::handleError($errorMessage,$this->name, $errorLevel);
}
public function exception($exception)
{
Error::handleException($exception);
}
}