<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Input; class StaticQueryUrl { public $map = array(); public $glue = '-'; private $query = array(); public function __construct($S904X = array()) { $this->map = $S904X; } public static function build($S904X = array('key' => 'k')) { return new static($S904X); } public function add($GUcFO, $F_a6B) { $this->map[$GUcFO] = $F_a6B; } public function create($xaAIg) { goto mJTfd; jtlWL: foreach ($xaAIg as $F_a6B => $JiRHR) { if (null === $JiRHR) { continue; } if (isset($this->map[$F_a6B])) { if (is_array($JiRHR)) { $XVqXz[] = $this->map[$F_a6B] . $JiRHR[0]; } else { $XVqXz[] = $this->map[$F_a6B] . urlencode("{$JiRHR}"); } } } goto m9yek; hQXB2: return join($this->glue, $XVqXz); goto rB2rm; m9yek: sort($XVqXz); goto hQXB2; mJTfd: $XVqXz = array(); goto jtlWL; rB2rm: } public function createMerge($xaAIg) { return $this->create(array_merge($this->query, $xaAIg)); } public function parse($wH_hT) { goto WpZmY; EkLJJ: foreach ($qiF5n as $V563N) { foreach ($this->map as $GUcFO => $F_a6B) { if (strpos($V563N, $F_a6B) === 0) { $xaAIg[$GUcFO] = substr($V563N, strlen($F_a6B)); } } } goto HLhpg; WpZmY: $xaAIg = array(); goto VYxJe; nJlT2: return $xaAIg; goto qZ2hW; VYxJe: $qiF5n = explode($this->glue, $wH_hT); goto EkLJJ; HLhpg: $this->query = $xaAIg; goto nJlT2; qZ2hW: } public function parseMergeQuery($xaAIg) { foreach ($xaAIg as $F_a6B => $JiRHR) { $this->query[$F_a6B] = $JiRHR; } } public function getQuery() { return $this->query; } }