66 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace addons\database;
use app\common\library\Menu;
use think\Addons;
/**
* 数据库插件
*/
class Database extends Addons
{
/**
* 插件安装方法
* @return bool
*/
public function install()
{
$menu = [
[
'name' => 'general/database',
'title' => '数据库管理',
'icon' => 'fa fa-database',
'remark' => '可进行一些简单的数据库表优化或修复查看表结构和数据也可以进行SQL语句的操作',
'sublist' => [
['name' => 'general/database/index', 'title' => '查看'],
['name' => 'general/database/query', 'title' => '查询'],
['name' => 'general/database/backup', 'title' => '备份'],
['name' => 'general/database/restore', 'title' => '恢复'],
]
]
];
Menu::create($menu, 'general');
return true;
}
/**
* 插件卸载方法
* @return bool
*/
public function uninstall()
{
Menu::delete('general/database');
return true;
}
/**
* 插件启用方法
*/
public function enable()
{
Menu::enable('general/database');
}
/**
* 插件禁用方法
*/
public function disable()
{
Menu::disable('general/database');
}
}