<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class CodeUtil { public static function cssRemoveComments($lDWj3) { goto ovNgT; Rn34C: $lDWj3 = str_replace('*/', 'COMEND__', $lDWj3); goto oEfvQ; oEfvQ: $lDWj3 = preg_replace('/__COMSTART[\\s\\S]*?COMEND__/s', '', $lDWj3); goto qlo9C; ovNgT: $lDWj3 = str_replace('/*', '__COMSTART', $lDWj3); goto Rn34C; qlo9C: return $lDWj3; goto xxEsL; xxEsL: } public static function jsRemoveComments($lDWj3) { goto V75JB; V75JB: $Evu3h = '/(?:(?:\\/\\*(?:[^*]|(?:\\*+[^*\\/]))*\\*+\\/)|(?:(?<!\\:|\\\\|\'|\\")\\/\\/.*))/'; goto ZKupd; ZKupd: $lDWj3 = preg_replace($Evu3h, '', $lDWj3); goto vCvV3; vCvV3: return $lDWj3; goto nkM0b; nkM0b: } public static function phpRemoveComments($lDWj3) { goto cimhw; ZJBhw: if (defined('T_DOC_COMMENT')) { $xcdm3[] = T_DOC_COMMENT; } goto pJm1K; B0fAR: $Th8fN = false; goto Mksk9; rGO0E: $D6xZt = token_get_all($lDWj3); goto B0fAR; ySE4d: $mv96a = array(); goto rGO0E; iBMLu: return join('', $mv96a); goto upcO8; cimhw: $xcdm3 = array(T_COMMENT); goto ZJBhw; Mksk9: foreach ($D6xZt as $uBuY2) { if (is_array($uBuY2)) { if (in_array($uBuY2[0], $xcdm3)) { continue; } $uBuY2 = $uBuY2[1]; } $mv96a[] = $uBuY2; } goto iBMLu; pJm1K: if (defined('T_ML_COMMENT')) { $xcdm3[] = T_ML_COMMENT; } goto ySE4d; upcO8: } public static function phpVarExport($F6pkn, $iOxFt = '') { switch (gettype($F6pkn)) { case 'string': if (strpos($F6pkn, ':RAW:') === 0) { return substr($F6pkn, strlen(':RAW:')); } return '"' . addcslashes($F6pkn, '\\$"
	') . '"'; case 'array': goto MR_0b; MR_0b: $S_LfG = array_keys($F6pkn) === range(0, count($F6pkn) - 1); goto OeiCD; OeiCD: $k2Agh = array(); goto TE2ni; v5CSr: return '[
' . implode(',
', $k2Agh) . '
' . $iOxFt . ']'; goto ubpRw; TE2ni: foreach ($F6pkn as $VFU9l => $HDpl6) { $k2Agh[] = "{$iOxFt}    " . ($S_LfG ? '' : self::phpVarExport($VFU9l) . ' => ') . self::phpVarExport($HDpl6, "{$iOxFt}    "); } goto v5CSr; ubpRw: case 'boolean': return $F6pkn ? 'true' : 'false'; default: return var_export($F6pkn, true); } } public static function phpVarExportReturnFile($F6pkn) { $BWI89 = self::phpVarExport($F6pkn); return '<' . "?php\nreturn {$BWI89};"; } public static function getFullClassNameForContent($BWI89) { goto kxHwI; S9YCF: return "{$Tp4s2}\\{$ottBC}"; goto ulaxY; BJCdw: if (empty($ottBC)) { return null; } goto S9YCF; wqGqu: if (empty($Tp4s2)) { return null; } goto yR9xL; kxHwI: $Tp4s2 = self::getClassNamespaceForContent($BWI89); goto wqGqu; yR9xL: $ottBC = self::getClassNameForContent($BWI89); goto BJCdw; ulaxY: } public static function getClassNameForContent($BWI89) { goto yjCdb; yjCdb: $CvHfI = array(); goto d02Cx; I4O4I: return $CvHfI[0]; goto PmLxH; d02Cx: $D6xZt = token_get_all($BWI89); goto Zg4uV; aoGT7: for ($tMyPy = 2; $tMyPy < $C6Thv; $tMyPy++) { if ($D6xZt[$tMyPy - 2][0] == T_CLASS && $D6xZt[$tMyPy - 1][0] == T_WHITESPACE && $D6xZt[$tMyPy][0] == T_STRING) { $oatgw = $D6xZt[$tMyPy][1]; $CvHfI[] = $oatgw; } } goto I4O4I; Zg4uV: $C6Thv = count($D6xZt); goto aoGT7; PmLxH: } public static function getClassNamespaceForContent($BWI89) { goto FExXV; ntTzS: $pT1FR = false; goto ESa_A; bhQVD: $Tp4s2 = ''; goto ntTzS; INRaR: $C6Thv = count($D6xZt); goto YnEFU; qIt53: if (!$pT1FR) { return null; } else { return $Tp4s2; } goto NfQdf; FExXV: $D6xZt = token_get_all($BWI89); goto INRaR; YnEFU: $tMyPy = 0; goto bhQVD; ESa_A: while ($tMyPy < $C6Thv) { $uBuY2 = $D6xZt[$tMyPy]; if (is_array($uBuY2) && $uBuY2[0] === T_NAMESPACE) { while (++$tMyPy < $C6Thv) { if ($D6xZt[$tMyPy] === ';') { goto aDzdk; dtcox: $Tp4s2 = trim($Tp4s2); goto Lqy6t; aDzdk: $pT1FR = true; goto dtcox; Lqy6t: break; goto oKiRn; oKiRn: } $Tp4s2 .= is_array($D6xZt[$tMyPy]) ? $D6xZt[$tMyPy][1] : $D6xZt[$tMyPy]; } break; } $tMyPy++; } goto qIt53; NfQdf: } public static function htmlBeauty($Q1WHV) { goto GypkR; GypkR: $k5j9p = \tidy_parse_string($Q1WHV, array('indent-spaces' => 4, 'indent' => true, 'output-xhtml' => true, 'show-body-only' => true, 'wrap' => 200), 'UTF8'); goto Hxx0b; JiiNN: return (string) $k5j9p; goto Zj2q0; Hxx0b: $k5j9p->cleanRepair(); goto JiiNN; Zj2q0: } }