<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Command; use Illuminate\Console\Command; use ModStart\Admin\Auth\Admin; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Input\Response; use ModStart\ModStart; use ModStart\Module\ModuleManager; class ModuleInstallAllCommand extends Command { protected $signature = 'modstart:module-install-all'; public function handle() { goto jjtCz; mBprK: if ($l4eHU) { goto TLztR; O57ai: if (!empty($l4eHU)) { if (ModelUtil::count('admin_user') <= 0) { foreach ($l4eHU as $R1R8O) { Admin::add($R1R8O['user'], $R1R8O['password']); } } } goto vqVOl; TLztR: $l4eHU = explode(';', $l4eHU); goto KBTr1; KBTr1: $l4eHU = array_map(function ($F6Fus) { list($OZ_pV, $Oedtb) = explode(':', $F6Fus); $OZ_pV = trim($OZ_pV); $Oedtb = trim($Oedtb); if (empty($OZ_pV) || empty($Oedtb)) { return null; } return array('user' => $OZ_pV, 'password' => $Oedtb); }, $l4eHU); goto zryr9; zryr9: $l4eHU = array_filter($l4eHU); goto O57ai; vqVOl: } goto Gad_2; uogdJ: foreach (ModuleManager::listAllInstalledModulesInRequiredOrder() as $h8H9D) { goto RQMxW; IMdco: if (Response::isSuccess($f3Nqc)) { $this->info($f3Nqc['data']['output']); } else { $this->error($f3Nqc['msg']); } goto ZenjX; ZenjX: $this->info(''); goto sflxH; GrKgU: $f3Nqc = ModuleManager::install($h8H9D); goto IMdco; mBdWI: $this->warn(">>> Module {$h8H9D} Installing"); goto GrKgU; RQMxW: if (!ModuleManager::isExists($h8H9D)) { continue; } goto mBdWI; sflxH: } goto HP2bc; jjtCz: $this->info('ModuleInstallAll
'); goto uogdJ; v0osa: $this->warn('ModuleInstallAll Run Finished'); goto Y4klU; HP2bc: $l4eHU = config('env.MS_INIT_ADMIN_USERS', ''); goto mBprK; Gad_2: $this->publishHotfixFiles(); goto v0osa; Y4klU: } private function publishHotfixFiles() { goto nK4bg; al0tp: $fFKJA = ModStart::env(); goto kClTT; oklb3: $RCoRX = @json_decode(file_get_contents($G4_3B), true); goto obL0w; kClTT: $wAXqx = rtrim(base_path('vendor/modstart/modstart/resources/hot_fix'), '/') . '/'; goto dFeUy; obL0w: foreach ($RCoRX as $rFWFp => $VF_G6) { goto SXwvM; oqc5n: @file_put_contents(base_path($VF_G6), $Afv_G); goto IZAd9; SXwvM: $Afv_G = file_get_contents($wAXqx . $fFKJA . '/' . $rFWFp); goto oqc5n; IZAd9: $this->info('Hotfix: ' . $VF_G6); goto yzACV; yzACV: } goto pWJtv; pWJtv: $this->info(''); goto ZNGIM; dFeUy: $G4_3B = $wAXqx . $fFKJA . '.json'; goto CSPIX; CSPIX: if (!file_exists($G4_3B)) { return; } goto oklb3; nK4bg: $this->warn('>>> Publish Hotfix'); goto al0tp; ZNGIM: } }