<?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 z8A6c; MMMoO: foreach (ModuleManager::listAllInstalledModulesInRequiredOrder() as $GVDx3) { goto FROvv; ETly3: $JOw_A = ModuleManager::install($GVDx3); goto b0Oyp; YPbTF: if (Response::isSuccess($JOw_A)) { $this->info($JOw_A['data']['output']); } else { $this->error($JOw_A['msg']); } goto MW1vK; FROvv: if (!ModuleManager::isExists($GVDx3)) { continue; } goto ETly3; b0Oyp: $this->warn(">>> Module {$GVDx3}"); goto YPbTF; MW1vK: $this->info(''); goto BO59h; BO59h: } goto DdXwu; HUaJq: $this->warn('ModuleInstallAll Run Finished'); goto lT8vj; dRYQl: $this->publishHotfixFiles(); goto HUaJq; z8A6c: $this->info('ModuleInstallAll
'); goto MMMoO; DdXwu: $BeHga = config('env.MS_INIT_ADMIN_USERS', ''); goto YgwM_; YgwM_: if ($BeHga) { goto DJxKq; sVquw: $BeHga = array_map(function ($tHq0l) { list($B02m7, $wX62V) = explode(':', $tHq0l); $B02m7 = trim($B02m7); $wX62V = trim($wX62V); if (empty($B02m7) || empty($wX62V)) { return null; } return array('user' => $B02m7, 'password' => $wX62V); }, $BeHga); goto cEgkM; DJxKq: $BeHga = explode(';', $BeHga); goto sVquw; FmUCX: if (!empty($BeHga)) { if (ModelUtil::count('admin_user') <= 0) { foreach ($BeHga as $YPEhu) { Admin::add($YPEhu['user'], $YPEhu['password']); } } } goto mbRyS; cEgkM: $BeHga = array_filter($BeHga); goto FmUCX; mbRyS: } goto dRYQl; lT8vj: } private function publishHotfixFiles() { goto V56Ks; V56Ks: $this->warn('>>> Publish Hotfix'); goto tUZbY; ewFGR: $wFJAI = $wg2e9 . $rMRoE . '.json'; goto GSY8U; jRB0j: $c8Hgd = @json_decode(file_get_contents($wFJAI), true); goto IE75K; IE75K: foreach ($c8Hgd as $Axl2s => $tGXA6) { goto S87ve; S87ve: $rFmqf = file_get_contents($wg2e9 . $rMRoE . '/' . $Axl2s); goto e4nDV; e4nDV: @file_put_contents(base_path($tGXA6), $rFmqf); goto mjypM; mjypM: $this->info('Hotfix: ' . $tGXA6); goto D1KXK; D1KXK: } goto W8fCi; tUZbY: $rMRoE = ModStart::env(); goto WinL0; W8fCi: $this->info(''); goto azC2M; GSY8U: if (!file_exists($wFJAI)) { return; } goto jRB0j; WinL0: $wg2e9 = rtrim(base_path('vendor/modstart/modstart/resources/hot_fix'), '/') . '/'; goto ewFGR; azC2M: } }