<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class CodeUtil { public static function cssRemoveComments($vq5E2) { goto xQsp8; upl6t: $vq5E2 = str_replace('*/', 'COMEND__', $vq5E2); goto zE4y9; BV_EG: return $vq5E2; goto eE28S; zE4y9: $vq5E2 = preg_replace('/__COMSTART[\\s\\S]*?COMEND__/s', '', $vq5E2); goto BV_EG; xQsp8: $vq5E2 = str_replace('/*', '__COMSTART', $vq5E2); goto upl6t; eE28S: } public static function jsRemoveComments($vq5E2) { goto OpQH1; Drj9e: return $vq5E2; goto aL5ky; xNSDH: $vq5E2 = preg_replace($dZQ2e, '', $vq5E2); goto Drj9e; OpQH1: $dZQ2e = '/(?:(?:\\/\\*(?:[^*]|(?:\\*+[^*\\/]))*\\*+\\/)|(?:(?<!\\:|\\\\|\'|\\")\\/\\/.*))/'; goto xNSDH; aL5ky: } public static function phpRemoveComments($vq5E2) { goto PgoWw; YjWCo: return join('', $dPhIV); goto YKrCT; PgoWw: $FW9Qi = array(T_COMMENT); goto CW9Hy; Gjs8u: $sg9K8 = token_get_all($vq5E2); goto nW4ql; XhINu: $dPhIV = array(); goto Gjs8u; nW4ql: $V1l4D = false; goto LMUrT; CW9Hy: if (defined('T_DOC_COMMENT')) { $FW9Qi[] = T_DOC_COMMENT; } goto nD_oN; LMUrT: foreach ($sg9K8 as $I82X8) { if (is_array($I82X8)) { if (in_array($I82X8[0], $FW9Qi)) { continue; } $I82X8 = $I82X8[1]; } $dPhIV[] = $I82X8; } goto YjWCo; nD_oN: if (defined('T_ML_COMMENT')) { $FW9Qi[] = T_ML_COMMENT; } goto XhINu; YKrCT: } public static function phpVarExport($mNsq_, $B3UWq = '') { switch (gettype($mNsq_)) { case 'string': if (strpos($mNsq_, ':RAW:') === 0) { return substr($mNsq_, strlen(':RAW:')); } return '"' . addcslashes($mNsq_, '\\$"
	') . '"'; case 'array': goto L5JST; WlHaK: return '[
' . implode(',
', $zdV1h) . '
' . $B3UWq . ']'; goto UajPS; jxqIx: foreach ($mNsq_ as $GUcFO => $ib3B9) { $zdV1h[] = "{$B3UWq}    " . ($VOUrB ? '' : self::phpVarExport($GUcFO) . ' => ') . self::phpVarExport($ib3B9, "{$B3UWq}    "); } goto WlHaK; xVypW: $zdV1h = array(); goto jxqIx; L5JST: $VOUrB = array_keys($mNsq_) === range(0, count($mNsq_) - 1); goto xVypW; UajPS: case 'boolean': return $mNsq_ ? 'true' : 'false'; default: return var_export($mNsq_, true); } } public static function phpVarExportReturnFile($mNsq_) { $ohNZt = self::phpVarExport($mNsq_); return '<' . "?php\nreturn {$ohNZt};"; } public static function getFullClassNameForContent($ohNZt) { goto qlFDf; rqDfa: return "{$yrdE4}\\{$lIzQw}"; goto zpXE1; v4FPN: if (empty($yrdE4)) { return null; } goto DESXr; qlFDf: $yrdE4 = self::getClassNamespaceForContent($ohNZt); goto v4FPN; i68Hu: if (empty($lIzQw)) { return null; } goto rqDfa; DESXr: $lIzQw = self::getClassNameForContent($ohNZt); goto i68Hu; zpXE1: } public static function getClassNameForContent($ohNZt) { goto Ie9nP; SR26s: for ($JhHfm = 2; $JhHfm < $cE0Z8; $JhHfm++) { if ($sg9K8[$JhHfm - 2][0] == T_CLASS && $sg9K8[$JhHfm - 1][0] == T_WHITESPACE && $sg9K8[$JhHfm][0] == T_STRING) { $nuAmt = $sg9K8[$JhHfm][1]; $FIoSm[] = $nuAmt; } } goto CbaKX; CbaKX: return $FIoSm[0]; goto H6Q0C; hntPm: $cE0Z8 = count($sg9K8); goto SR26s; Ie9nP: $FIoSm = array(); goto i3EDL; i3EDL: $sg9K8 = token_get_all($ohNZt); goto hntPm; H6Q0C: } public static function getClassNamespaceForContent($ohNZt) { goto GxDZe; O5fcK: $cE0Z8 = count($sg9K8); goto QS0k9; GxDZe: $sg9K8 = token_get_all($ohNZt); goto O5fcK; Qo3RB: if (!$CZ9ww) { return null; } else { return $yrdE4; } goto glYaY; tQ3Ww: $yrdE4 = ''; goto TzYlp; TzYlp: $CZ9ww = false; goto mupBV; QS0k9: $JhHfm = 0; goto tQ3Ww; mupBV: while ($JhHfm < $cE0Z8) { $I82X8 = $sg9K8[$JhHfm]; if (is_array($I82X8) && $I82X8[0] === T_NAMESPACE) { while (++$JhHfm < $cE0Z8) { if ($sg9K8[$JhHfm] === ';') { goto hRfn5; DutIH: break; goto Zkgmq; SNqJF: $yrdE4 = trim($yrdE4); goto DutIH; hRfn5: $CZ9ww = true; goto SNqJF; Zkgmq: } $yrdE4 .= is_array($sg9K8[$JhHfm]) ? $sg9K8[$JhHfm][1] : $sg9K8[$JhHfm]; } break; } $JhHfm++; } goto Qo3RB; glYaY: } public static function htmlBeauty($oAyDf) { goto ARayy; UQRTC: return (string) $wHdg_; goto MU3wJ; ARayy: $wHdg_ = \tidy_parse_string($oAyDf, array('indent-spaces' => 4, 'indent' => true, 'output-xhtml' => true, 'show-body-only' => true, 'wrap' => 200), 'UTF8'); goto Xhlnp; Xhlnp: $wHdg_->cleanRepair(); goto UQRTC; MU3wJ: } }