mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
Refactoring user permissions
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Nexus\Plugin\BasePlugin;
|
||||
|
||||
class Plugin extends Command
|
||||
{
|
||||
@@ -30,11 +31,18 @@ class Plugin extends Command
|
||||
$plugin = new \Nexus\Plugin\Plugin();
|
||||
$action = $this->argument('action');
|
||||
$name = $this->argument('name');
|
||||
/** @var BasePlugin $mainClass */
|
||||
$mainClass = $plugin->getMainClass($name);
|
||||
if (!$mainClass) {
|
||||
$this->error("Can not find plugin: $name");
|
||||
return 1;
|
||||
}
|
||||
try {
|
||||
$mainClass->checkMainApplicationVersion();
|
||||
} catch (\Exception $exception) {
|
||||
$this->error($exception->getMessage());
|
||||
return 1;
|
||||
}
|
||||
if ($action == 'install') {
|
||||
call_user_func([$mainClass, 'install']);
|
||||
} elseif ($action == 'uninstall') {
|
||||
|
||||
Reference in New Issue
Block a user