<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Command; use Illuminate\Console\Command; use ModStart\Core\Exception\BizException; use ModStart\Module\ModuleManager; class ModuleInstallCommand extends Command { protected $signature = 'modstart:module-install {module}'; public function handle() { goto WdZds; SGsoM: $this->publishAsset($l2LYK); goto TUNBY; JCFpc: $this->migrate($l2LYK); goto SGsoM; WdZds: $l2LYK = $this->argument('module'); goto Fw0Fn; Fw0Fn: BizException::throwsIf('Keep Old Password If Empty', !ModuleManager::isExists($l2LYK)); goto JCFpc; TUNBY: } private function migrate($l2LYK) { goto mVHjv; BgyuN: if (!file_exists($ceAjB)) { return; } goto b32YZ; b32YZ: $this->info('Module Migrate Success'); goto jfCjO; jfCjO: $this->call('migrate', array('--path' => ModuleManager::relativePath($l2LYK, 'Migrate'))); goto PzAB2; mVHjv: $ceAjB = ModuleManager::path($l2LYK, 'Migrate'); goto BgyuN; PzAB2: } private function publishAsset($l2LYK) { goto j0wz_; ilW3U: $Gp4Ek = public_path("vendor/{$l2LYK}/"); goto m3zzo; XoIUa: if (!file_exists($RNE_j)) { return; } goto ilW3U; j0wz_: $E1O_W = $this->laravel['files']; goto TaShL; m3zzo: if (file_exists($Gp4Ek)) { $this->info('Module Asset Publish : Ignore'); return; } goto kO00Q; TaShL: $RNE_j = ModuleManager::path($l2LYK, 'Asset') . '/'; goto XoIUa; lHMby: $E1O_W->copyDirectory($RNE_j, $Gp4Ek); goto RKMfw; kO00Q: $E1O_W->deleteDirectory($Gp4Ek); goto lHMby; RKMfw: $this->info("Module Asset Publish : {$RNE_j} -> {$Gp4Ek}"); goto PUuwk; PUuwk: } }