<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Type\TypeUtil; use ModStart\Core\Util\ConstantUtil; use ModStart\Core\Util\SerializeUtil; use Module\Vendor\Support\ResponseCodes; include_once __DIR__ . '/../Shell/include.php'; class FeUtil { public static function tools($B13iK) { goto SF1Wg; gH7D3: $aYY2W = $GLOBALS['argv']; goto XvT6E; XvT6E: if ($NTX2_ < 2) { goto cT1ZP; cT1ZP: shell_echo_error('参数错误'); goto EGVA_; EGVA_: shell_echo('构建 constant.js → php tools.php DumpConstant'); goto FSGWh; FSGWh: die(1); goto ab1d5; ab1d5: } goto uoobI; eIf8U: $miBo6 = $hId04[2]; goto NlkEg; NlkEg: shell_echo_block('Uniapp Tools'); goto OVO_M; OVO_M: $NTX2_ = $GLOBALS['argc']; goto gH7D3; iKLLs: $yIC2_ = $VMUqm . 'tools.config.json'; goto AyDZs; uoobI: $VMUqm = rtrim($B13iK, '/') . '/'; goto iKLLs; QZbes: $ltDK0 = $hId04[1]; goto eIf8U; pq65T: switch ($aYY2W[1]) { case 'DumpConstant': goto m1gUd; GySoB: break; goto Qp7EP; YUB2c: $ybjC4[] = '// This file is created by -> php tools.php DumpConstant'; goto jzWq6; jzWq6: foreach ($qMWfl as $zO6V5 => $ftmr1) { $ybjC4[] = "export const {$zO6V5} = " . SerializeUtil::jsonEncodePretty($ftmr1) . ';'; } goto xhsWY; NIG_Q: $bohO7 = "{$VMUqm}src/{$Kahxr}/constant.js"; goto sfVit; sfVit: file_put_contents($bohO7, $ybjC4); goto GySoB; r5v2K: $Kahxr = $miBo6 === 'mobile' ? 'config' : 'lib'; goto NIG_Q; G34Cl: $qMWfl = array(); goto jZsmW; hE_g3: $ybjC4 = array(); goto YUB2c; xhsWY: $ybjC4 = implode('

', $ybjC4); goto r5v2K; jZsmW: foreach ($H4hQU['constants'] as $zO6V5) { switch ($zO6V5) { case 'ResponseCodes': goto jdOeZ; db_8R: shell_echo_info("导出 {$zO6V5}"); goto tLfIb; tLfIb: break; goto O6s2l; jdOeZ: $qMWfl['ResponseCodes'] = ConstantUtil::dump(ResponseCodes::class); goto db_8R; O6s2l: default: goto sYGhA; bAXr2: break; goto RwjN3; yWQL9: $qMWfl[class_basename($zO6V5)] = TypeUtil::dump($zO6V5); goto E6Edl; E6Edl: shell_echo_info("导出 {$zO6V5}"); goto bAXr2; sYGhA: shell_throws_if('类型不存在 ' . $zO6V5, !class_exists($zO6V5)); goto yWQL9; RwjN3: } } goto hE_g3; m1gUd: shell_throws_if('请配置 constants', empty($H4hQU['constants'])); goto G34Cl; Qp7EP: default: shell_echo_error('不支持的命令 ' . $aYY2W[1]); die(1); } goto lnlyK; Bhs7Y: $H4hQU = json_decode(file_get_contents($yIC2_), true); goto pq65T; SF1Wg: if (!preg_match('/module[\\/\\\\](.*?)[\\/\\\\]resources\\/(.*?)\\/?$/', $B13iK, $hId04)) { shell_echo_error('目录不正确'); die(1); } goto QZbes; AyDZs: shell_throws_if('文件不存在 ' . $yIC2_, !file_exists($yIC2_)); goto Bhs7Y; lnlyK: } }