<?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 z9aUl; w1Sgr: $lefmL = new ModuleEnabledEvent(); goto RaniU; oSQYe: ModStart::clearCache(); goto dORql; z9aUl: $GVDx3 = $this->argument('module'); goto Tw6iq; Er9sp: $KALZg = ModuleManager::getModuleBasic($GVDx3); goto rOApR; rOApR: BizException::throwsIf('Module basic empty', !$KALZg); goto Gg3eJ; Tw6iq: BizException::throwsIf(L('Module Invalid'), !ModuleManager::isExists($GVDx3)); goto ZiqKJ; EJ_WU: ModuleManager::saveUserInstalledModules($ENyP_); goto oSQYe; RaniU: $lefmL->name = $GVDx3; goto ofWQQ; ofWQQ: if (PHP_VERSION_ID >= 80000) { Event::dispatch($lefmL); } else { Event::fire($lefmL); } goto G0TgS; dORql: ModuleManager::callHook($GVDx3, 'hookEnabled'); goto w1Sgr; Gg3eJ: $ENyP_[$GVDx3]['enable'] = true; goto EJ_WU; ZiqKJ: $ENyP_ = ModuleManager::listAllInstalledModules(); goto Er9sp; G0TgS: $this->info('Module Enable Success'); goto MoamW; MoamW: } }