<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Command; use Illuminate\Console\Command; use Illuminate\Support\Facades\Event; use ModStart\Core\Events\ModuleDisabledEvent; use ModStart\Core\Exception\BizException; use ModStart\ModStart; use ModStart\Module\ModuleManager; class ModuleDisableCommand extends Command { protected $signature = 'modstart:module-disable {module}'; public function handle() { goto d0zWz; aVjR_: BizException::throwsIf(L('Module Invalid'), !ModuleManager::isExists($satFX)); goto FgOAX; ATRYJ: $YlbOr = ModuleManager::getModuleBasic($satFX); goto FedUn; XjQIz: $this->info('Module Disable Success'); goto ii2GY; xV8ud: ModuleManager::callHook($satFX, 'hookBeforeDisable'); goto l3AJS; d0zWz: $satFX = $this->argument('module'); goto aVjR_; NLMy1: $BHEro->name = $satFX; goto AYA3x; AYA3x: if (PHP_VERSION_ID >= 80000) { Event::dispatch($BHEro); } else { Event::fire($BHEro); } goto XjQIz; axB2D: ModStart::clearCache(); goto LttHN; FgOAX: $EZWyg = ModuleManager::listAllInstalledModules(); goto ATRYJ; FedUn: BizException::throwsIf('Module basic empty', !$YlbOr); goto xV8ud; LttHN: $BHEro = new ModuleDisabledEvent(); goto NLMy1; C1A0g: ModuleManager::saveUserInstalledModules($EZWyg); goto axB2D; l3AJS: $EZWyg[$satFX]['enable'] = false; goto C1A0g; ii2GY: } }