| Total Complexity | 5 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class DictionaryPlugin extends Plugin |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * DictionaryPlugin constructor. |
||
| 11 | */ |
||
| 12 | protected function __construct() |
||
| 13 | { |
||
| 14 | parent::__construct( |
||
| 15 | '1.0', |
||
| 16 | 'Julio Montoya', |
||
| 17 | [ |
||
| 18 | 'enable_plugin_dictionary' => 'boolean', |
||
| 19 | ] |
||
| 20 | ); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @return DictionaryPlugin|null |
||
| 25 | */ |
||
| 26 | public static function create() |
||
| 27 | { |
||
| 28 | static $result = null; |
||
| 29 | |||
| 30 | return $result ? $result : $result = new self(); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Installation process. |
||
| 35 | */ |
||
| 36 | public function install() |
||
| 37 | { |
||
| 38 | $sql = "CREATE TABLE IF NOT EXISTS plugin_dictionary ( |
||
| 39 | id INT NOT NULL AUTO_INCREMENT, |
||
| 40 | term VARCHAR(255) NOT NULL, |
||
| 41 | definition LONGTEXT NOT NULL, |
||
| 42 | PRIMARY KEY (id)); |
||
| 43 | "; |
||
| 44 | Database::query($sql); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Uninstall process. |
||
| 49 | */ |
||
| 50 | public function uninstall() |
||
| 54 | } |
||
| 55 | } |
||
| 56 |