<?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 KKiZw; KKiZw: $this->info('ModuleInstallAll
'); goto WuB0L; jYHB3: $this->publishHotfixFiles(); goto qwQ_O; WuB0L: foreach (ModuleManager::listAllInstalledModulesInRequiredOrder() as $vbusR) { goto NhYtR; H4aOQ: $this->warn(">>> Module {$vbusR} Installing"); goto x2XC8; rfzBs: if (Response::isSuccess($UdQ1p)) { $this->info($UdQ1p['data']['output']); } else { $this->error($UdQ1p['msg']); } goto rHaVd; NhYtR: if (!ModuleManager::isExists($vbusR)) { continue; } goto H4aOQ; x2XC8: $UdQ1p = ModuleManager::install($vbusR); goto rfzBs; rHaVd: $this->info(''); goto h9QQN; h9QQN: } goto niz1m; qwQ_O: $this->warn('ModuleInstallAll Run Finished'); goto hQ_ZI; niz1m: $sHxmZ = config('env.MS_INIT_ADMIN_USERS', ''); goto EfGH0; EfGH0: if ($sHxmZ) { goto rOWkS; n7X2S: if (!empty($sHxmZ)) { if (ModelUtil::count('admin_user') <= 0) { foreach ($sHxmZ as $rT7wJ) { Admin::add($rT7wJ['user'], $rT7wJ['password']); } } } goto vAZN4; AGw3Z: $sHxmZ = array_map(function ($VFelt) { list($wf0it, $SQma7) = explode(':', $VFelt); $wf0it = trim($wf0it); $SQma7 = trim($SQma7); if (empty($wf0it) || empty($SQma7)) { return null; } return array('user' => $wf0it, 'password' => $SQma7); }, $sHxmZ); goto Z9DZA; rOWkS: $sHxmZ = explode(';', $sHxmZ); goto AGw3Z; Z9DZA: $sHxmZ = array_filter($sHxmZ); goto n7X2S; vAZN4: } goto jYHB3; hQ_ZI: } private function publishHotfixFiles() { goto NEPfE; M2wpD: $QZmRA = ModStart::env(); goto u_YT4; gyJr7: $bG1t2 = @json_decode(file_get_contents($YrvUk), true); goto E_S5Y; u_YT4: $l3Ovo = rtrim(base_path('vendor/modstart/modstart/resources/hot_fix'), '/') . '/'; goto ZPadK; yM80V: $this->info(''); goto Gems9; E_S5Y: foreach ($bG1t2 as $QRy1p => $S3tfG) { goto RY3MV; Rt0_p: @file_put_contents(base_path($S3tfG), $DTnPC); goto bnRS5; RY3MV: $DTnPC = file_get_contents($l3Ovo . $QZmRA . '/' . $QRy1p); goto Rt0_p; bnRS5: $this->info('Hotfix: ' . $S3tfG); goto vJonY; vJonY: } goto yM80V; NEPfE: $this->warn('>>> Publish Hotfix'); goto M2wpD; de7eI: if (!file_exists($YrvUk)) { return; } goto gyJr7; ZPadK: $YrvUk = $l3Ovo . $QZmRA . '.json'; goto de7eI; Gems9: } }