<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Input; class StaticQueryUrl { public $map = array(); public $glue = '-'; private $query = array(); public function __construct($WOJ4L = array()) { $this->map = $WOJ4L; } public static function build($WOJ4L = array('key' => 'k')) { return new static($WOJ4L); } public function add($dwwIV, $plrwN) { $this->map[$dwwIV] = $plrwN; } public function create($hAzJ1) { goto iUduA; gCfwx: return join($this->glue, $VzVt9); goto nwSiW; YW6FV: sort($VzVt9); goto gCfwx; pE4WQ: foreach ($hAzJ1 as $plrwN => $uTz0e) { if (null === $uTz0e) { continue; } if (isset($this->map[$plrwN])) { if (is_array($uTz0e)) { $VzVt9[] = $this->map[$plrwN] . $uTz0e[0]; } else { $VzVt9[] = $this->map[$plrwN] . urlencode("{$uTz0e}"); } } } goto YW6FV; iUduA: $VzVt9 = array(); goto pE4WQ; nwSiW: } public function createMerge($hAzJ1) { return $this->create(array_merge($this->query, $hAzJ1)); } public function parse($NdGuK) { goto GQwFf; ieJH_: $this->query = $hAzJ1; goto gDRPr; K4e3N: $MaTBT = explode($this->glue, $NdGuK); goto QWP6F; gDRPr: return $hAzJ1; goto y_V02; GQwFf: $hAzJ1 = array(); goto K4e3N; QWP6F: foreach ($MaTBT as $ZpLX1) { foreach ($this->map as $dwwIV => $plrwN) { if (strpos($ZpLX1, $plrwN) === 0) { $hAzJ1[$dwwIV] = substr($ZpLX1, strlen($plrwN)); } } } goto ieJH_; y_V02: } public function parseMergeQuery($hAzJ1) { foreach ($hAzJ1 as $plrwN => $uTz0e) { $this->query[$plrwN] = $uTz0e; } } public function getQuery() { return $this->query; } }