<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Command; use Illuminate\Console\Command; use Illuminate\Support\Facades\Event; use ModStart\Core\Events\ModuleEnabledEvent; use ModStart\Core\Exception\BizException; use ModStart\ModStart; use ModStart\Module\ModuleManager; class ModuleEnableCommand extends Command { protected $signature = 'modstart:module-enable {module}'; public function handle() { goto KkF3U; Zz17S: $this->info('Module Enable Success'); goto mZp6u; BkS4r: $EZWyg = ModuleManager::listAllInstalledModules(); goto In7ao; VzWXL: ModStart::clearCache(); goto VefHU; KwPDk: BizException::throwsIf('Module basic empty', !$YlbOr); goto tSyR5; tyTuw: $BHEro->name = $satFX; goto crcDT; VefHU: ModuleManager::callHook($satFX, 'hookEnabled'); goto mJQeq; TtIpr: ModuleManager::saveUserInstalledModules($EZWyg); goto VzWXL; Bwfes: BizException::throwsIf(L('Module Invalid'), !ModuleManager::isExists($satFX)); goto BkS4r; KkF3U: $satFX = $this->argument('module'); goto Bwfes; tSyR5: $EZWyg[$satFX]['enable'] = true; goto TtIpr; mJQeq: $BHEro = new ModuleEnabledEvent(); goto tyTuw; In7ao: $YlbOr = ModuleManager::getModuleBasic($satFX); goto KwPDk; crcDT: if (PHP_VERSION_ID >= 80000) { Event::dispatch($BHEro); } else { Event::fire($BHEro); } goto Zz17S; mZp6u: } }