You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							55 lines
						
					
					
						
							1.1 KiB
						
					
					
				
			
		
		
	
	
							55 lines
						
					
					
						
							1.1 KiB
						
					
					
				<?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);
 | 
						|
    }
 | 
						|
}
 | 
						|
 |