<?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 j3mzE; BHb20: foreach (ModuleManager::listAllInstalledModulesInRequiredOrder() as $satFX) { goto nBdwx; Rzk2C: $this->info(''); goto x0qyA; j1FZR: $N2Xaa = ModuleManager::install($satFX); goto MNQGj; hfo62: $this->warn(">>> Module {$satFX} Installing"); goto j1FZR; MNQGj: if (Response::isSuccess($N2Xaa)) { $this->info($N2Xaa['data']['output']); } else { $this->error($N2Xaa['msg']); } goto Rzk2C; nBdwx: if (!ModuleManager::isExists($satFX)) { continue; } goto hfo62; x0qyA: } goto JClE3; JClE3: $QbFhI = config('env.MS_INIT_ADMIN_USERS', ''); goto IAhGI; IAhGI: if ($QbFhI) { goto k5IJM; UKOPC: if (!empty($QbFhI)) { if (ModelUtil::count('admin_user') <= 0) { foreach ($QbFhI as $Pxw1_) { Admin::add($Pxw1_['user'], $Pxw1_['password']); } } } goto eZyBi; V16db: $QbFhI = array_map(function ($pk5fc) { list($KD3DH, $f8snf) = explode(':', $pk5fc); $KD3DH = trim($KD3DH); $f8snf = trim($f8snf); if (empty($KD3DH) || empty($f8snf)) { return null; } return array('user' => $KD3DH, 'password' => $f8snf); }, $QbFhI); goto LZjfI; k5IJM: $QbFhI = explode(';', $QbFhI); goto V16db; LZjfI: $QbFhI = array_filter($QbFhI); goto UKOPC; eZyBi: } goto Eg7s0; Eg7s0: $this->publishHotfixFiles(); goto kXEZq; j3mzE: $this->info('ModuleInstallAll
'); goto BHb20; kXEZq: $this->warn('ModuleInstallAll Run Finished'); goto QkK5f; QkK5f: } private function publishHotfixFiles() { goto SRJcT; AlR8l: foreach ($L3_o5 as $ZT1n0 => $adFNb) { goto LHYvK; lDbe5: $this->info('Hotfix: ' . $adFNb); goto e_O2I; LHYvK: $LTC5O = file_get_contents($jUDXv . $V3q1i . '/' . $ZT1n0); goto afhYN; afhYN: @file_put_contents(base_path($adFNb), $LTC5O); goto lDbe5; e_O2I: } goto xVLmm; e5XL3: if (!file_exists($GDg_y)) { return; } goto IhzRG; f3ygx: $V3q1i = ModStart::env(); goto CiOHc; xVLmm: $this->info(''); goto QyXlj; CiOHc: $jUDXv = rtrim(base_path('vendor/modstart/modstart/resources/hot_fix'), '/') . '/'; goto QSnoW; SRJcT: $this->warn('>>> Publish Hotfix'); goto f3ygx; IhzRG: $L3_o5 = @json_decode(file_get_contents($GDg_y), true); goto AlR8l; QSnoW: $GDg_y = $jUDXv . $V3q1i . '.json'; goto e5XL3; QyXlj: } }