<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class CodeUtil { public static function cssRemoveComments($vu_fe) { goto w15j5; HIbK2: $vu_fe = preg_replace('/__COMSTART[\\s\\S]*?COMEND__/s', '', $vu_fe); goto AKWxq; w15j5: $vu_fe = str_replace('/*', '__COMSTART', $vu_fe); goto sNjVN; sNjVN: $vu_fe = str_replace('*/', 'COMEND__', $vu_fe); goto HIbK2; AKWxq: return $vu_fe; goto aeoP0; aeoP0: } public static function jsRemoveComments($vu_fe) { goto Ag1Vr; WTprp: return $vu_fe; goto LOToP; Ag1Vr: $sSTic = '/(?:(?:\\/\\*(?:[^*]|(?:\\*+[^*\\/]))*\\*+\\/)|(?:(?<!\\:|\\\\|\'|\\")\\/\\/.*))/'; goto oDYOZ; oDYOZ: $vu_fe = preg_replace($sSTic, '', $vu_fe); goto WTprp; LOToP: } public static function phpRemoveComments($vu_fe) { goto wj3jo; h8kTx: $dQmY3 = array(); goto LZvWA; PuPDa: if (defined('T_DOC_COMMENT')) { $vPgUd[] = T_DOC_COMMENT; } goto MrhU1; imc16: return join('', $dQmY3); goto vG7_K; Saw8Q: foreach ($Q_m81 as $xT5sm) { if (is_array($xT5sm)) { if (in_array($xT5sm[0], $vPgUd)) { continue; } $xT5sm = $xT5sm[1]; } $dQmY3[] = $xT5sm; } goto imc16; LZvWA: $Q_m81 = token_get_all($vu_fe); goto ZYZWn; ZYZWn: $xlyUY = false; goto Saw8Q; wj3jo: $vPgUd = array(T_COMMENT); goto PuPDa; MrhU1: if (defined('T_ML_COMMENT')) { $vPgUd[] = T_ML_COMMENT; } goto h8kTx; vG7_K: } public static function phpVarExport($aT02R, $Tr7EM = '') { switch (gettype($aT02R)) { case 'string': if (strpos($aT02R, ':RAW:') === 0) { return substr($aT02R, strlen(':RAW:')); } return '"' . addcslashes($aT02R, '\\$"
	') . '"'; case 'array': goto ePzsn; pCq1j: return '[
' . implode(',
', $u7ouj) . '
' . $Tr7EM . ']'; goto eJCri; c6uTC: foreach ($aT02R as $ax5t3 => $FT9zA) { $u7ouj[] = "{$Tr7EM}    " . ($BRFik ? '' : self::phpVarExport($ax5t3) . ' => ') . self::phpVarExport($FT9zA, "{$Tr7EM}    "); } goto pCq1j; ePzsn: $BRFik = array_keys($aT02R) === range(0, count($aT02R) - 1); goto lNXux; lNXux: $u7ouj = array(); goto c6uTC; eJCri: case 'boolean': return $aT02R ? 'true' : 'false'; default: return var_export($aT02R, true); } } public static function phpVarExportReturnFile($aT02R) { $rFmqf = self::phpVarExport($aT02R); return "<?php\nreturn {$rFmqf};"; } public static function getFullClassNameForContent($rFmqf) { goto bLxtv; WhqCO: $ac3f3 = self::getClassNameForContent($rFmqf); goto dnw20; dnw20: if (empty($ac3f3)) { return null; } goto vffVs; bLxtv: $Uz_X9 = self::getClassNamespaceForContent($rFmqf); goto Z2wVy; Z2wVy: if (empty($Uz_X9)) { return null; } goto WhqCO; vffVs: return "{$Uz_X9}\\{$ac3f3}"; goto GdYNd; GdYNd: } public static function getClassNameForContent($rFmqf) { goto PTKhg; bQat5: for ($eQWJY = 2; $eQWJY < $mmw1h; $eQWJY++) { if ($Q_m81[$eQWJY - 2][0] == T_CLASS && $Q_m81[$eQWJY - 1][0] == T_WHITESPACE && $Q_m81[$eQWJY][0] == T_STRING) { $vAOP1 = $Q_m81[$eQWJY][1]; $vsVpX[] = $vAOP1; } } goto Fyxnv; Fyxnv: return $vsVpX[0]; goto d3YUw; VVv5Y: $Q_m81 = token_get_all($rFmqf); goto OxHJN; PTKhg: $vsVpX = array(); goto VVv5Y; OxHJN: $mmw1h = count($Q_m81); goto bQat5; d3YUw: } public static function getClassNamespaceForContent($rFmqf) { goto msc4c; DO9hm: $HqcR3 = false; goto L_uGI; zVw1d: if (!$HqcR3) { return null; } else { return $Uz_X9; } goto GkQDx; v0ug9: $mmw1h = count($Q_m81); goto dYRma; msc4c: $Q_m81 = token_get_all($rFmqf); goto v0ug9; az_ZP: $Uz_X9 = ''; goto DO9hm; dYRma: $eQWJY = 0; goto az_ZP; L_uGI: while ($eQWJY < $mmw1h) { $xT5sm = $Q_m81[$eQWJY]; if (is_array($xT5sm) && $xT5sm[0] === T_NAMESPACE) { while (++$eQWJY < $mmw1h) { if ($Q_m81[$eQWJY] === ';') { goto Rr0Q5; zShNW: $Uz_X9 = trim($Uz_X9); goto K3XnT; K3XnT: break; goto oU7Yl; Rr0Q5: $HqcR3 = true; goto zShNW; oU7Yl: } $Uz_X9 .= is_array($Q_m81[$eQWJY]) ? $Q_m81[$eQWJY][1] : $Q_m81[$eQWJY]; } break; } $eQWJY++; } goto zVw1d; GkQDx: } public static function htmlBeauty($lSp6_) { goto Ismy4; p5WqB: $Xfag4->cleanRepair(); goto k3ege; Ismy4: $Xfag4 = tidy_parse_string($lSp6_, array('indent-spaces' => 4, 'indent' => true, 'output-xhtml' => true, 'show-body-only' => true, 'wrap' => 200), 'UTF8'); goto p5WqB; k3ege: return (string) $Xfag4; goto ezi82; ezi82: } }