2020-06-24 10:07:11 +08:00
|
|
|
|
<?php
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | CatchAdmin [Just Like ~ ]
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | Author: JaguarJack [ njphper@gmail.com ]
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
namespace catcher\command\install;
|
|
|
|
|
|
2020-07-01 15:47:06 +08:00
|
|
|
|
use catchAdmin\permissions\model\Permissions;
|
2020-06-24 10:07:11 +08:00
|
|
|
|
use catcher\CatchAdmin;
|
2020-09-11 07:42:38 +08:00
|
|
|
|
use catcher\library\InstallLocalModule;
|
2020-06-24 10:07:11 +08:00
|
|
|
|
use think\console\Command;
|
|
|
|
|
use think\console\Input;
|
|
|
|
|
use think\console\input\Argument;
|
|
|
|
|
use think\console\Output;
|
|
|
|
|
|
|
|
|
|
class EnableModuleCommand extends Command
|
|
|
|
|
{
|
|
|
|
|
protected function configure()
|
|
|
|
|
{
|
|
|
|
|
$this->setName('enable:module')
|
|
|
|
|
->addArgument('module', Argument::REQUIRED, 'module name')
|
|
|
|
|
->setDescription('enable catch module');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function execute(Input $input, Output $output)
|
|
|
|
|
{
|
|
|
|
|
$module = $input->getArgument('module');
|
|
|
|
|
|
|
|
|
|
if (empty(CatchAdmin::getModuleInfo(CatchAdmin::directory() .$module))) {
|
|
|
|
|
$output->error("module [$module] not exist");
|
|
|
|
|
} else {
|
2020-09-11 07:42:38 +08:00
|
|
|
|
(new InstallLocalModule($module))->enableModule();
|
2020-06-24 10:07:11 +08:00
|
|
|
|
$output->info("module [$module] enabled");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|