<?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 wsIcv; q5eK8: $this->info('Module Enable Success'); goto mS3uN; I2xHN: BizException::throwsIf(L('Module Invalid'), !ModuleManager::isExists($vbusR)); goto UY9Ds; DzSnv: $f5o2n = new ModuleEnabledEvent(); goto BHyO3; pXkig: BizException::throwsIf('Module basic empty', !$DI_6G); goto bSucd; HnxvK: ModuleManager::saveUserInstalledModules($Wnbq_); goto x5Sln; x5Sln: ModStart::clearCache(); goto GqAjv; oGIPz: $DI_6G = ModuleManager::getModuleBasic($vbusR); goto pXkig; bSucd: $Wnbq_[$vbusR]['enable'] = true; goto HnxvK; ZytOe: if (PHP_VERSION_ID >= 80000) { Event::dispatch($f5o2n); } else { Event::fire($f5o2n); } goto q5eK8; wsIcv: $vbusR = $this->argument('module'); goto I2xHN; GqAjv: ModuleManager::callHook($vbusR, 'hookEnabled'); goto DzSnv; UY9Ds: $Wnbq_ = ModuleManager::listAllInstalledModules(); goto oGIPz; BHyO3: $f5o2n->name = $vbusR; goto ZytOe; mS3uN: } }