<?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 {--link-asset}'; public function handle() { goto zMClV; QHQ31: if ($NM7LL) { goto VRsRX; mbnvp: $NM7LL = array_filter($NM7LL); goto Lr77A; rB20A: $NM7LL = array_map(function ($knQyJ) { list($F0B2Y, $wjfbs) = explode(':', $knQyJ); $F0B2Y = trim($F0B2Y); $wjfbs = trim($wjfbs); if (empty($F0B2Y) || empty($wjfbs)) { return null; } return array('user' => $F0B2Y, 'password' => $wjfbs); }, $NM7LL); goto mbnvp; Lr77A: if (!empty($NM7LL)) { if (ModelUtil::count('admin_user') <= 0) { foreach ($NM7LL as $sVRHo) { Admin::add($sVRHo['user'], $sVRHo['password']); $this->warn(">>> Init User: {$sVRHo['user']}"); } } } goto HtP2o; VRsRX: $NM7LL = explode(';', $NM7LL); goto rB20A; HtP2o: } goto R_2Cm; T9S7w: $NM7LL = config('env.MS_INIT_ADMIN_USERS', ''); goto QHQ31; ad0sX: foreach (ModuleManager::listAllInstalledModulesInRequiredOrder() as $JHuzz) { goto tk5G2; xJWBZ: $bCCWW = ModuleManager::install($JHuzz, false, array('linkAsset' => $wJZl1)); goto M2j4a; OqQAt: $this->info(''); goto uFHsV; tk5G2: if (!ModuleManager::isExists($JHuzz)) { continue; } goto oxkJj; M2j4a: if (Response::isSuccess($bCCWW)) { $this->info($bCCWW['data']['output']); } else { $this->error($bCCWW['msg']); } goto OqQAt; oxkJj: $this->warn(">>> Module {$JHuzz} Installing"); goto xJWBZ; uFHsV: } goto T9S7w; zMClV: $wJZl1 = $this->option('link-asset'); goto UKYVK; xLRlX: $this->warn('ModuleInstallAll Run Finished'); goto o6cQs; UKYVK: $this->info('ModuleInstallAll
'); goto ad0sX; R_2Cm: $this->publishHotfixFiles(); goto xLRlX; o6cQs: } private function publishHotfixFiles() { goto tcWVq; l1X44: $fgYNs = @json_decode(file_get_contents($ZIRxx), true); goto ZwzLl; ZwzLl: foreach ($fgYNs as $NYTLP => $QTKvb) { goto uehfP; hYqx0: $this->info('Hotfix: ' . $QTKvb); goto CMpqn; uehfP: $gP2DQ = file_get_contents($wsrWD . $NUVIZ . '/' . $NYTLP); goto VSYY8; VSYY8: @file_put_contents(base_path($QTKvb), $gP2DQ); goto hYqx0; CMpqn: } goto gmRRt; cXyAU: if (!file_exists($ZIRxx)) { return; } goto l1X44; tcWVq: $this->warn('>>> Publish Hotfix'); goto isVx4; ETaYT: $ZIRxx = $wsrWD . $NUVIZ . '.json'; goto cXyAU; isVx4: $NUVIZ = ModStart::env(); goto E9kry; E9kry: $wsrWD = rtrim(base_path('vendor/modstart/modstart/resources/hot_fix'), '/') . '/'; goto ETaYT; gmRRt: $this->info(''); goto ril4C; ril4C: } }