upgrade
This commit is contained in:
55
plugin/dictionary/DictionaryPlugin.php
Normal file
55
plugin/dictionary/DictionaryPlugin.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
/**
|
||||
* Class DictionaryPlugin.
|
||||
*/
|
||||
class DictionaryPlugin extends Plugin
|
||||
{
|
||||
/**
|
||||
* DictionaryPlugin constructor.
|
||||
*/
|
||||
protected function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
'1.0',
|
||||
'Julio Montoya',
|
||||
[
|
||||
'enable_plugin_dictionary' => 'boolean',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DictionaryPlugin|null
|
||||
*/
|
||||
public static function create()
|
||||
{
|
||||
static $result = null;
|
||||
|
||||
return $result ? $result : $result = new self();
|
||||
}
|
||||
|
||||
/**
|
||||
* Installation process.
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
$sql = "CREATE TABLE IF NOT EXISTS plugin_dictionary (
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
term VARCHAR(255) NOT NULL,
|
||||
definition LONGTEXT NOT NULL,
|
||||
PRIMARY KEY (id));
|
||||
";
|
||||
Database::query($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Uninstall process.
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
$sql = "DROP TABLE IF EXISTS plugin_dictionary";
|
||||
Database::query($sql);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user