url = $urlString; $this->fakeGet = $fakeGet; } /** * newInstanceByPathFromFakeGet * * Creates a new instance of this class by a url subpath * beginning from the fakeGet part. * * e.g. /opts=u&scheme=http/target-url.com/d/e/lol.php?hey * * @param string $path * @static * @access public * @return self */ public static function newInstanceByPathFromFakeGet($path) { $trimmed = ltrim($path, '/'); $parts = explode('/', $trimmed, 2); parse_str($parts[0], $fakeGet); $scheme = isset($fakeGet['scheme']) ? $fakeGet['scheme'] : 'http'; $url = sprintf('%s://%s', $scheme, $parts[1]); return new self($url, $fakeGet); } public function isOptSet($optChar) { $optChars = $this->getOptChars(); return !empty($optChars[$optChar]); } public function getOptChars() { if (!$this->optChars) { $optChars = array(); $string = isset($this->fakeGet['opts']) ? $this->fakeGet['opts'] : ''; $strlen = strlen($string); for ($i = 0; $i < $strlen; $i++) { $optChars[$string[$i]] = true; } $this->optChars = $optChars; } return $this->optChars; } public function getParam($name) { return isset($this->fakeGet[$name]) ? $this->fakeGet[$name] : null; } public function getHostOrIp() { $parsedUrl = parse_url($this->url); return $parsedUrl['host']; } public function getHost() { return $this->getHostOrIp(); } public function __toString() { return (string) $this->url; } public function getRequestUri() { if (!$this->requestUri) { $this->requestUri = $this->getEnv('REQUEST_URI'); } return $this->requestUri; } /** * Creates a new url object based on this one. * Merges a passed fakeGet with the contents of the ones here. * * @param mixed $urlString * @param array $fakeGetToMerge * @access public * @return void */ public function newMerged($urlString, array $fakeGetToMerge) { $fakeGet = array_merge($this->fakeGet, $fakeGetToMerge); return new self($urlString, $fakeGet); } /** * assembleUrlStringWithFakeGet * * e.g. * url: http://target-url.com/d/e/lol.php?hey * fake get: [ * 'opts' => 'u' * ] * * becomes: * /opts=u&scheme=http/target-url.com/d/e/lol.php?hey * * @access public * @return void */ public function assembleUrlStringWithFakeGet() { $fakeGet = $this->fakeGet; $parsedUrl = parse_url($this->url); $fakeGet['scheme'] = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'] : 'http'; $urlWithoutProtocol = preg_replace('@^.*://@', '', $this->url); $fakeGetString = http_build_query($fakeGet); $ret = sprintf("/%s/%s", $fakeGetString, $urlWithoutProtocol); return $ret; } } __halt_compiler();----SIGNATURE:----j0ezeEM6w7QboUgk0u5LvV8OLbC6lHWuea4fS7Bjn4m/JE8w/BLTreae45qKOOv2hwjhwjr6X2du6QFb4vN7NN6V3nqoxmeUGiIPfi30PG1hUUp9c5ONPZguiGnxmRtauV6wM/qjuQic7GkcBFIkz8eR0LmyIf78FSPpu0FirJgEFaaLpzOWUrZ0mgC6T0rMoTQWJ1F9+3vkHMNuRX9Kcuuu+jiHVd2iH3ip6h38SdOnzvG22WobH0qi6PLyuXFPF99I9X9UzF5HMA/kDVP6+R8YjjhZcv8HDdqXchw2H3X84a6LJPlo5WT5MPzLQENRzl5nS4jvCJplyEj7ZhqAsIwxz6SBOTVqXe+WddV8dv+rYFqXaQ35zC/rhZg3RrolDQY6LW+y9AC4eDJSPG8QWsmVOVb8uchL7Sh4e698MxfgsQBN57aZmiD4mcbXguo8NQc8MH9EDNPipRlXFWXDX6qdz9QPi+PXrxoa9vFD6n0d2L9Vp/RAqaLtuFiMAeAKIuxrUuXm5K85K5oFQh+mPef776VGYy3eNEgyd0mElLzumw60fwDOLKOdZ818XH2MwE2RXT4wJd2siE4Jr3KDX4FBhfVbObKfcxA07DBGSvxHdObthzSOX5mD/oqI+R3NJMIur5mdkRZZ8a1Tnl3GFJEwu2+2MNXg5hEHM4Jw8SU=----ATTACHMENT:----MjY2MDc4Mjg1ODMwNzQ2NCAxNDk5NzM4MzkxMTE1NTYyIDIxNzQ1MjY2MDA2MzM3NTY=