<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Input; class StaticQueryUrl { public $map = array(); public $glue = '-'; private $query = array(); public function __construct($eYURB = array()) { $this->map = $eYURB; } public static function build($eYURB = array('key' => 'k')) { return new static($eYURB); } public function add($jPfeB, $RTHJ6) { $this->map[$jPfeB] = $RTHJ6; } public function create($sFfhd) { goto d6oZy; d6oZy: $m2Dmo = array(); goto jFZ4b; jFZ4b: foreach ($sFfhd as $RTHJ6 => $F6Fus) { if (null === $F6Fus) { continue; } if (isset($this->map[$RTHJ6])) { if (is_array($F6Fus)) { $m2Dmo[] = $this->map[$RTHJ6] . $F6Fus[0]; } else { $m2Dmo[] = $this->map[$RTHJ6] . urlencode("{$F6Fus}"); } } } goto g0wKr; g0wKr: sort($m2Dmo); goto g8BHI; g8BHI: return join($this->glue, $m2Dmo); goto H_kO3; H_kO3: } public function createMerge($sFfhd) { return $this->create(array_merge($this->query, $sFfhd)); } public function parse($xN43X) { goto dLHpD; ijakL: foreach ($dJE62 as $Xvngd) { foreach ($this->map as $jPfeB => $RTHJ6) { if (strpos($Xvngd, $RTHJ6) === 0) { $sFfhd[$jPfeB] = substr($Xvngd, strlen($RTHJ6)); } } } goto HNq12; HNq12: $this->query = $sFfhd; goto BrE77; dLHpD: $sFfhd = array(); goto Hr9R2; Hr9R2: $dJE62 = explode($this->glue, $xN43X); goto ijakL; BrE77: return $sFfhd; goto gw5jV; gw5jV: } public function parseMergeQuery($sFfhd) { foreach ($sFfhd as $RTHJ6 => $F6Fus) { $this->query[$RTHJ6] = $F6Fus; } } public function getQuery() { return $this->query; } }