<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Input; class StaticQueryUrl { public $map = array(); public $glue = '-'; private $query = array(); public function __construct($NnNhz = array()) { $this->map = $NnNhz; } public static function build($NnNhz = array('key' => 'k')) { return new static($NnNhz); } public function add($m1RYi, $U9AsU) { $this->map[$m1RYi] = $U9AsU; } public function create($ZqQec) { goto RWh10; CRFGq: sort($BV17G); goto wP3PB; wP3PB: return join($this->glue, $BV17G); goto q65Mw; RWh10: $BV17G = array(); goto uFkMH; uFkMH: foreach ($ZqQec as $U9AsU => $ohYVl) { if (null === $ohYVl) { continue; } if (isset($this->map[$U9AsU])) { if (is_array($ohYVl)) { $BV17G[] = $this->map[$U9AsU] . $ohYVl[0]; } else { $BV17G[] = $this->map[$U9AsU] . urlencode("{$ohYVl}"); } } } goto CRFGq; q65Mw: } public function createMerge($ZqQec) { return $this->create(array_merge($this->query, $ZqQec)); } public function parse($g5laZ) { goto FeTGl; TkRnF: $br8h9 = explode($this->glue, $g5laZ); goto sW4zh; K4u9n: $this->query = $ZqQec; goto gPtGb; gPtGb: return $ZqQec; goto XM3XH; sW4zh: $NnNhz = array(); goto BdhBu; FeTGl: $ZqQec = array(); goto TkRnF; BdhBu: foreach ($br8h9 as $Nrp0b) { foreach ($this->map as $m1RYi => $U9AsU) { if (strpos($Nrp0b, $U9AsU) === 0) { $ZqQec[$m1RYi] = substr($Nrp0b, strlen($U9AsU)); } } } goto K4u9n; XM3XH: } public function parseMergeQuery($ZqQec) { foreach ($ZqQec as $U9AsU => $ohYVl) { $this->query[$U9AsU] = $ohYVl; } } public function getQuery() { return $this->query; } }