<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class CodeUtil { public static function cssRemoveComments($pXRGe) { goto nMZJR; nMZJR: $pXRGe = str_replace('/*', '__COMSTART', $pXRGe); goto vTxz8; kNY1Z: $pXRGe = preg_replace('/__COMSTART[\\s\\S]*?COMEND__/s', '', $pXRGe); goto oL5sh; vTxz8: $pXRGe = str_replace('*/', 'COMEND__', $pXRGe); goto kNY1Z; oL5sh: return $pXRGe; goto IX_sz; IX_sz: } public static function jsRemoveComments($pXRGe) { goto CwqgD; uSWal: return $pXRGe; goto tt3QC; CwqgD: $UOHC7 = '/(?:(?:\\/\\*(?:[^*]|(?:\\*+[^*\\/]))*\\*+\\/)|(?:(?<!\\:|\\\\|\'|\\")\\/\\/.*))/'; goto FfVrR; FfVrR: $pXRGe = preg_replace($UOHC7, '', $pXRGe); goto uSWal; tt3QC: } public static function phpRemoveComments($pXRGe) { goto lALun; lALun: $tAd70 = array(T_COMMENT); goto aq2ef; wCyEW: foreach ($IbZvl as $R0P9s) { if (is_array($R0P9s)) { if (in_array($R0P9s[0], $tAd70)) { continue; } $R0P9s = $R0P9s[1]; } $FRLL5[] = $R0P9s; } goto uqXJg; ph_Ne: if (defined('T_ML_COMMENT')) { $tAd70[] = T_ML_COMMENT; } goto JGlqZ; JGlqZ: $FRLL5 = array(); goto DO77b; jb60s: $BxuA8 = false; goto wCyEW; uqXJg: return join('', $FRLL5); goto GAW2X; DO77b: $IbZvl = token_get_all($pXRGe); goto jb60s; aq2ef: if (defined('T_DOC_COMMENT')) { $tAd70[] = T_DOC_COMMENT; } goto ph_Ne; GAW2X: } public static function phpVarExport($uyfgy, $VNCHo = '') { switch (gettype($uyfgy)) { case 'string': if (strpos($uyfgy, ':RAW:') === 0) { return substr($uyfgy, strlen(':RAW:')); } return '"' . addcslashes($uyfgy, '\\$"
	') . '"'; case 'array': goto EtzL2; sbY9T: return '[
' . implode(',
', $m86pK) . '
' . $VNCHo . ']'; goto VifjG; EtzL2: $IIo5O = array_keys($uyfgy) === range(0, count($uyfgy) - 1); goto lQm8d; KRDRJ: foreach ($uyfgy as $dwwIV => $wvO30) { $m86pK[] = "{$VNCHo}    " . ($IIo5O ? '' : self::phpVarExport($dwwIV) . ' => ') . self::phpVarExport($wvO30, "{$VNCHo}    "); } goto sbY9T; lQm8d: $m86pK = array(); goto KRDRJ; VifjG: case 'boolean': return $uyfgy ? 'true' : 'false'; default: return var_export($uyfgy, true); } } public static function phpVarExportReturnFile($uyfgy) { $cgjRu = self::phpVarExport($uyfgy); return '<' . "?php\nreturn {$cgjRu};"; } public static function getFullClassNameForContent($cgjRu) { goto TzuUi; RbPZU: if (empty($OC_qG)) { return null; } goto eQR8M; VwNts: if (empty($q5sLX)) { return null; } goto sJ0aR; sJ0aR: return "{$OC_qG}\\{$q5sLX}"; goto ItKEV; TzuUi: $OC_qG = self::getClassNamespaceForContent($cgjRu); goto RbPZU; eQR8M: $q5sLX = self::getClassNameForContent($cgjRu); goto VwNts; ItKEV: } public static function getClassNameForContent($cgjRu) { goto GoTty; DJ4zT: $mp0hs = count($IbZvl); goto TFztW; Fg8Bk: return $fvnxZ[0]; goto zj8r2; TFztW: for ($UCcmA = 2; $UCcmA < $mp0hs; $UCcmA++) { if ($IbZvl[$UCcmA - 2][0] == T_CLASS && $IbZvl[$UCcmA - 1][0] == T_WHITESPACE && $IbZvl[$UCcmA][0] == T_STRING) { $ayKTX = $IbZvl[$UCcmA][1]; $fvnxZ[] = $ayKTX; } } goto Fg8Bk; Puu2q: $IbZvl = token_get_all($cgjRu); goto DJ4zT; GoTty: $fvnxZ = array(); goto Puu2q; zj8r2: } public static function getClassNamespaceForContent($cgjRu) { goto CZCHF; vyVOW: $mp0hs = count($IbZvl); goto RYiTv; TzLbs: while ($UCcmA < $mp0hs) { $R0P9s = $IbZvl[$UCcmA]; if (is_array($R0P9s) && $R0P9s[0] === T_NAMESPACE) { while (++$UCcmA < $mp0hs) { if ($IbZvl[$UCcmA] === ';') { goto vIaap; MrucB: $OC_qG = trim($OC_qG); goto aiVxz; vIaap: $BpGl_ = true; goto MrucB; aiVxz: break; goto h7kgI; h7kgI: } $OC_qG .= is_array($IbZvl[$UCcmA]) ? $IbZvl[$UCcmA][1] : $IbZvl[$UCcmA]; } break; } $UCcmA++; } goto k31Yv; RYiTv: $UCcmA = 0; goto EyiUg; k31Yv: if (!$BpGl_) { return null; } else { return $OC_qG; } goto nb03a; pRjjg: $BpGl_ = false; goto TzLbs; EyiUg: $OC_qG = ''; goto pRjjg; CZCHF: $IbZvl = token_get_all($cgjRu); goto vyVOW; nb03a: } public static function htmlBeauty($YUOG2) { goto OhUaL; v5hnG: return (string) $VxwQB; goto Unyjn; c9w8z: $VxwQB->cleanRepair(); goto v5hnG; OhUaL: $VxwQB = \tidy_parse_string($YUOG2, array('indent-spaces' => 4, 'indent' => true, 'output-xhtml' => true, 'show-body-only' => true, 'wrap' => 200), 'UTF8'); goto c9w8z; Unyjn: } }