<?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 AGfVJ; AGfVJ: $this->info('ModuleInstallAll
'); goto fNa9N; fNa9N: foreach (ModuleManager::listAllInstalledModulesInRequiredOrder() as $oXHYw) { goto GIH1r; zIvfS: $this->info(''); goto LqYYV; G7ecH: $this->warn(">>> Module {$oXHYw} Installing"); goto xxnvv; xxnvv: $Z5nZL = ModuleManager::install($oXHYw); goto rZoK_; rZoK_: if (Response::isSuccess($Z5nZL)) { $this->info($Z5nZL['data']['output']); } else { $this->error($Z5nZL['msg']); } goto zIvfS; GIH1r: if (!ModuleManager::isExists($oXHYw)) { continue; } goto G7ecH; LqYYV: } goto RlQcR; Lz4Qu: $this->publishHotfixFiles(); goto jbY7I; n6o6i: if ($wG2AQ) { goto VJCFg; m0qwy: if (!empty($wG2AQ)) { if (ModelUtil::count('admin_user') <= 0) { foreach ($wG2AQ as $gEJU7) { Admin::add($gEJU7['user'], $gEJU7['password']); $this->warn(">>> Init User: {$gEJU7['user']}"); } } } goto w11Vs; VJCFg: $wG2AQ = explode(';', $wG2AQ); goto mGMur; mGMur: $wG2AQ = array_map(function ($Q0rz2) { list($b8XSV, $njstY) = explode(':', $Q0rz2); $b8XSV = trim($b8XSV); $njstY = trim($njstY); if (empty($b8XSV) || empty($njstY)) { return null; } return array('user' => $b8XSV, 'password' => $njstY); }, $wG2AQ); goto MpBLb; MpBLb: $wG2AQ = array_filter($wG2AQ); goto m0qwy; w11Vs: } goto Lz4Qu; jbY7I: $this->warn('ModuleInstallAll Run Finished'); goto Px7eb; RlQcR: $wG2AQ = config('env.MS_INIT_ADMIN_USERS', ''); goto n6o6i; Px7eb: } private function publishHotfixFiles() { goto LeQ6d; g334I: $this->info(''); goto sZQI8; LeQ6d: $this->warn('>>> Publish Hotfix'); goto a0B8j; xkG5N: $Ese1E = @json_decode(file_get_contents($hJK83), true); goto ko9f4; ufgzc: if (!file_exists($hJK83)) { return; } goto xkG5N; a0B8j: $x3_wu = ModStart::env(); goto j70aT; j70aT: $Exs9r = rtrim(base_path('vendor/modstart/modstart/resources/hot_fix'), '/') . '/'; goto QK4LH; ko9f4: foreach ($Ese1E as $Sch6x => $nAf_0) { goto uXh0U; uXh0U: $BWI89 = file_get_contents($Exs9r . $x3_wu . '/' . $Sch6x); goto uizQp; x0MlC: $this->info('Hotfix: ' . $nAf_0); goto MTOpB; uizQp: @file_put_contents(base_path($nAf_0), $BWI89); goto x0MlC; MTOpB: } goto g334I; QK4LH: $hJK83 = $Exs9r . $x3_wu . '.json'; goto ufgzc; sZQI8: } }