<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Input; class StaticQueryUrl { public $map = array(); public $glue = '-'; private $query = array(); public function __construct($gROn3 = array()) { $this->map = $gROn3; } public static function build($gROn3 = array('key' => 'k')) { return new static($gROn3); } public function add($l6tBV, $B34tD) { $this->map[$l6tBV] = $B34tD; } public function create($LBO09) { goto i2HwJ; i2HwJ: $ik1Qg = array(); goto I91_L; I91_L: foreach ($LBO09 as $B34tD => $Xz28r) { if (null === $Xz28r) { continue; } if (isset($this->map[$B34tD])) { if (is_array($Xz28r)) { $ik1Qg[] = $this->map[$B34tD] . $Xz28r[0]; } else { $ik1Qg[] = $this->map[$B34tD] . urlencode("{$Xz28r}"); } } } goto hlkZ6; hlkZ6: sort($ik1Qg); goto RVuvS; RVuvS: return join($this->glue, $ik1Qg); goto DJgs9; DJgs9: } public function createMerge($LBO09) { return $this->create(array_merge($this->query, $LBO09)); } public function parse($AtymD) { goto Kr673; vj9rM: return $LBO09; goto L4vQR; pnVrZ: $this->query = $LBO09; goto vj9rM; Kr673: $LBO09 = array(); goto a7x_V; SUdWX: foreach ($JlsAT as $Esk0p) { foreach ($this->map as $l6tBV => $B34tD) { if (strpos($Esk0p, $B34tD) === 0) { $LBO09[$l6tBV] = substr($Esk0p, strlen($B34tD)); } } } goto pnVrZ; a7x_V: $JlsAT = explode($this->glue, $AtymD); goto SUdWX; L4vQR: } public function parseMergeQuery($LBO09) { foreach ($LBO09 as $B34tD => $Xz28r) { $this->query[$B34tD] = $Xz28r; } } public function getQuery() { return $this->query; } }