<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Input; class StaticQueryUrl { public $map = array(); public $glue = '-'; private $query = array(); public function __construct($SRxBF = array()) { $this->map = $SRxBF; } public static function build($SRxBF = array('key' => 'k')) { return new static($SRxBF); } public function add($ax5t3, $kh68j) { $this->map[$ax5t3] = $kh68j; } public function create($AOBVZ) { goto FfIkt; NiFaN: return join($this->glue, $xIfit); goto R4BI1; Qervx: foreach ($AOBVZ as $kh68j => $tHq0l) { if (null === $tHq0l) { continue; } if (isset($this->map[$kh68j])) { if (is_array($tHq0l)) { $xIfit[] = $this->map[$kh68j] . $tHq0l[0]; } else { $xIfit[] = $this->map[$kh68j] . urlencode("{$tHq0l}"); } } } goto HsIsM; HsIsM: sort($xIfit); goto NiFaN; FfIkt: $xIfit = array(); goto Qervx; R4BI1: } public function createMerge($AOBVZ) { return $this->create(array_merge($this->query, $AOBVZ)); } public function parse($QOfU2) { goto R5vWZ; fWvuR: $SkjWT = explode($this->glue, $QOfU2); goto Yq_m4; Yq_m4: foreach ($SkjWT as $El_MH) { foreach ($this->map as $ax5t3 => $kh68j) { if (strpos($El_MH, $kh68j) === 0) { $AOBVZ[$ax5t3] = substr($El_MH, strlen($kh68j)); } } } goto ykDhn; s6Ox4: return $AOBVZ; goto I19fu; ykDhn: $this->query = $AOBVZ; goto s6Ox4; R5vWZ: $AOBVZ = array(); goto fWvuR; I19fu: } public function parseMergeQuery($AOBVZ) { foreach ($AOBVZ as $kh68j => $tHq0l) { $this->query[$kh68j] = $tHq0l; } } public function getQuery() { return $this->query; } }