<?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 j40f5; c379r: $this->publishHotfixFiles(); goto TZ1pY; xe02A: $SiZSZ = config('env.MS_INIT_ADMIN_USERS', ''); goto ERrqt; j40f5: $this->info('ModuleInstallAll
'); goto QTR18; TZ1pY: $this->warn('ModuleInstallAll Run Finished'); goto Jj0Sl; QTR18: foreach (ModuleManager::listAllInstalledModulesInRequiredOrder() as $tUxPr) { goto WaHP1; omjWN: $this->warn(">>> Module {$tUxPr} Installing"); goto FZImQ; WaHP1: if (!ModuleManager::isExists($tUxPr)) { continue; } goto omjWN; KqSqL: $this->info(''); goto MUO4w; FZImQ: $ZIe4d = ModuleManager::install($tUxPr); goto Ke4vg; Ke4vg: if (Response::isSuccess($ZIe4d)) { $this->info($ZIe4d['data']['output']); } else { $this->error($ZIe4d['msg']); } goto KqSqL; MUO4w: } goto xe02A; ERrqt: if ($SiZSZ) { goto ZtLpA; PSODU: $SiZSZ = array_map(function ($Xz28r) { list($afnCM, $V3jYa) = explode(':', $Xz28r); $afnCM = trim($afnCM); $V3jYa = trim($V3jYa); if (empty($afnCM) || empty($V3jYa)) { return null; } return array('user' => $afnCM, 'password' => $V3jYa); }, $SiZSZ); goto U3I3b; ZtLpA: $SiZSZ = explode(';', $SiZSZ); goto PSODU; G6jEg: if (!empty($SiZSZ)) { if (ModelUtil::count('admin_user') <= 0) { foreach ($SiZSZ as $saLcb) { Admin::add($saLcb['user'], $saLcb['password']); $this->warn(">>> Init User: {$saLcb['user']}"); } } } goto YVMpv; U3I3b: $SiZSZ = array_filter($SiZSZ); goto G6jEg; YVMpv: } goto c379r; Jj0Sl: } private function publishHotfixFiles() { goto HmzoG; VbYzD: if (!file_exists($Vdc9o)) { return; } goto q9hY6; O5ZCK: $XoENN = ModStart::env(); goto NY_Bo; HmzoG: $this->warn('>>> Publish Hotfix'); goto O5ZCK; OwsIt: $this->info(''); goto f1ljE; NY_Bo: $vuDvR = rtrim(base_path('vendor/modstart/modstart/resources/hot_fix'), '/') . '/'; goto jjbG2; jjbG2: $Vdc9o = $vuDvR . $XoENN . '.json'; goto VbYzD; QJ_QA: foreach ($mpJUG as $Qf9vs => $YhsOb) { goto Um5ip; LHiAW: $this->info('Hotfix: ' . $YhsOb); goto XVeo5; Wf67d: @file_put_contents(base_path($YhsOb), $vVYCS); goto LHiAW; Um5ip: $vVYCS = file_get_contents($vuDvR . $XoENN . '/' . $Qf9vs); goto Wf67d; XVeo5: } goto OwsIt; q9hY6: $mpJUG = @json_decode(file_get_contents($Vdc9o), true); goto QJ_QA; f1ljE: } }