<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Input; class StaticQueryUrl { public $map = array(); public $glue = '-'; private $query = array(); public function __construct($yNqI3 = array()) { $this->map = $yNqI3; } public static function build($yNqI3 = array('key' => 'k')) { return new static($yNqI3); } public function add($HQKqq, $Fkd1C) { $this->map[$HQKqq] = $Fkd1C; } public function create($qeoqS) { goto ec1AU; ke6dj: sort($iERFh); goto srh8H; srh8H: return join($this->glue, $iERFh); goto eeWld; aQKvM: foreach ($qeoqS as $Fkd1C => $pk5fc) { if (null === $pk5fc) { continue; } if (isset($this->map[$Fkd1C])) { if (is_array($pk5fc)) { $iERFh[] = $this->map[$Fkd1C] . $pk5fc[0]; } else { $iERFh[] = $this->map[$Fkd1C] . urlencode("{$pk5fc}"); } } } goto ke6dj; ec1AU: $iERFh = array(); goto aQKvM; eeWld: } public function createMerge($qeoqS) { return $this->create(array_merge($this->query, $qeoqS)); } public function parse($X8D33) { goto bnxol; bnxol: $qeoqS = array(); goto o7UFH; dMWlN: foreach ($H01Cn as $yFnpO) { foreach ($this->map as $HQKqq => $Fkd1C) { if (strpos($yFnpO, $Fkd1C) === 0) { $qeoqS[$HQKqq] = substr($yFnpO, strlen($Fkd1C)); } } } goto xMuUr; o39Wl: return $qeoqS; goto pz9o_; xMuUr: $this->query = $qeoqS; goto o39Wl; o7UFH: $H01Cn = explode($this->glue, $X8D33); goto dMWlN; pz9o_: } public function parseMergeQuery($qeoqS) { foreach ($qeoqS as $Fkd1C => $pk5fc) { $this->query[$Fkd1C] = $pk5fc; } } public function getQuery() { return $this->query; } }