Total Complexity | 6 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class DictionaryPlugin extends Plugin |
||
9 | { |
||
10 | /** |
||
11 | * DictionaryPlugin constructor. |
||
12 | */ |
||
13 | protected function __construct() |
||
20 | ] |
||
21 | ); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @return DictionaryPlugin|null |
||
26 | */ |
||
27 | public static function create() |
||
28 | { |
||
29 | static $result = null; |
||
30 | |||
31 | return $result ?: $result = new self(); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Installation process. |
||
36 | */ |
||
37 | public function install() |
||
38 | { |
||
39 | $sql = 'CREATE TABLE IF NOT EXISTS plugin_dictionary ( |
||
40 | id INT NOT NULL AUTO_INCREMENT, |
||
41 | term VARCHAR(255) NOT NULL, |
||
42 | definition LONGTEXT NOT NULL, |
||
43 | PRIMARY KEY (id)); |
||
44 | '; |
||
45 | Database::query($sql); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * Uninstall process. |
||
50 | */ |
||
51 | public function uninstall() |
||
55 | } |
||
56 | |||
57 | public function get_name() |
||
60 | } |
||
61 | } |
||
62 |