<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Input; class StaticQueryUrl { public $map = array(); public $glue = '-'; private $query = array(); public function __construct($NRcb0 = array()) { $this->map = $NRcb0; } public static function build($NRcb0 = array('key' => 'k')) { return new static($NRcb0); } public function add($oMJcb, $lxIPA) { $this->map[$oMJcb] = $lxIPA; } public function create($nYIOS) { goto ptA88; bU8TL: foreach ($nYIOS as $lxIPA => $knQyJ) { if (null === $knQyJ) { continue; } if (isset($this->map[$lxIPA])) { if (is_array($knQyJ)) { $MiLaY[] = $this->map[$lxIPA] . $knQyJ[0]; } else { $MiLaY[] = $this->map[$lxIPA] . urlencode("{$knQyJ}"); } } } goto jhWll; jhWll: sort($MiLaY); goto WyBjZ; ptA88: $MiLaY = array(); goto bU8TL; WyBjZ: return join($this->glue, $MiLaY); goto OQLvK; OQLvK: } public function createMerge($nYIOS) { return $this->create(array_merge($this->query, $nYIOS)); } public function parse($BnyEK) { goto eNiDl; XctUv: foreach ($wG3zg as $P1uVJ) { foreach ($this->map as $oMJcb => $lxIPA) { if (strpos($P1uVJ, $lxIPA) === 0) { $nYIOS[$oMJcb] = substr($P1uVJ, strlen($lxIPA)); } } } goto H2EO8; AZ6cT: return $nYIOS; goto kUkAp; eNiDl: $nYIOS = array(); goto zq4x8; zq4x8: $wG3zg = explode($this->glue, $BnyEK); goto XctUv; H2EO8: $this->query = $nYIOS; goto AZ6cT; kUkAp: } public function parseMergeQuery($nYIOS) { foreach ($nYIOS as $lxIPA => $knQyJ) { $this->query[$lxIPA] = $knQyJ; } } public function getQuery() { return $this->query; } }