<?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 hRIHQ; W1s0y: $this->publishHotfixFiles(); goto UWlx0; UWlx0: $this->warn('ModuleInstallAll Run Finished'); goto jYRYQ; hRIHQ: $this->info('ModuleInstallAll
'); goto Ltqc2; ItyRu: $KCFiB = config('env.MS_INIT_ADMIN_USERS', ''); goto CdBhw; Ltqc2: foreach (ModuleManager::listAllInstalledModulesInRequiredOrder() as $uacrl) { goto MV3xK; u_WIf: if (Response::isSuccess($gbVzz)) { $this->info($gbVzz['data']['output']); } else { $this->error($gbVzz['msg']); } goto X70b2; xF5WD: $this->warn(">>> Module {$uacrl} Installing"); goto LoS98; MV3xK: if (!ModuleManager::isExists($uacrl)) { continue; } goto xF5WD; LoS98: $gbVzz = ModuleManager::install($uacrl); goto u_WIf; X70b2: $this->info(''); goto BLo0T; BLo0T: } goto ItyRu; CdBhw: if ($KCFiB) { goto uZUp_; uZUp_: $KCFiB = explode(';', $KCFiB); goto sX0Zw; sX0Zw: $KCFiB = array_map(function ($JiRHR) { list($TzHqb, $cv0ME) = explode(':', $JiRHR); $TzHqb = trim($TzHqb); $cv0ME = trim($cv0ME); if (empty($TzHqb) || empty($cv0ME)) { return null; } return array('user' => $TzHqb, 'password' => $cv0ME); }, $KCFiB); goto yCV02; yCV02: $KCFiB = array_filter($KCFiB); goto CPngq; CPngq: if (!empty($KCFiB)) { if (ModelUtil::count('admin_user') <= 0) { foreach ($KCFiB as $xpWk8) { Admin::add($xpWk8['user'], $xpWk8['password']); $this->warn(">>> Init User: {$xpWk8['user']}"); } } } goto Uim8h; Uim8h: } goto W1s0y; jYRYQ: } private function publishHotfixFiles() { goto Acx8R; KqP7f: $this->info(''); goto y_kct; uNSem: $C_a2Q = rtrim(base_path('vendor/modstart/modstart/resources/hot_fix'), '/') . '/'; goto WlnkK; Acx8R: $this->warn('>>> Publish Hotfix'); goto sVzst; fQx7f: $xoOBk = @json_decode(file_get_contents($Yy8AR), true); goto l22U3; sVzst: $JKwNL = ModStart::env(); goto uNSem; Vvx4j: if (!file_exists($Yy8AR)) { return; } goto fQx7f; WlnkK: $Yy8AR = $C_a2Q . $JKwNL . '.json'; goto Vvx4j; l22U3: foreach ($xoOBk as $w_wjF => $aurrr) { goto nYG9O; WpZju: @file_put_contents(base_path($aurrr), $ohNZt); goto ZxV6Y; ZxV6Y: $this->info('Hotfix: ' . $aurrr); goto Ydtd0; nYG9O: $ohNZt = file_get_contents($C_a2Q . $JKwNL . '/' . $w_wjF); goto WpZju; Ydtd0: } goto KqP7f; y_kct: } }