ARC2::getRequestURI PHP Method

getRequestURI() static public method

static public getRequestURI ( )
    static function getRequestURI()
    {
        if (isset($_SERVER) && isset($_SERVER['REQUEST_URI'])) {
            return preg_replace('/^([a-z]+)\\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'])) . '://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']) . ($_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : '') . $_SERVER['REQUEST_URI'];
        }
        return ARC2::getScriptURI();
    }

Usage Example

 function parse($q, $src = '', $iso_fallback = 'ignore')
 {
     $this->setDefaultPrefixes();
     $this->base = $src ? $this->calcBase($src) : ARC2::getRequestURI();
     $this->r = array('base' => '', 'vars' => array(), 'prefixes' => array());
     $this->unparsed_code = $q;
     list($r, $v) = $this->xQuery($q);
     if ($r) {
         $this->r['query'] = $r;
         $this->unparsed_code = trim($v);
     } elseif (!$this->getErrors() && !$this->unparsed_code) {
         $this->addError('Query not properly closed');
     }
     $this->r['prefixes'] = $this->prefixes;
     $this->r['base'] = $this->base;
     /* remove trailing comments */
     while (preg_match('/^\\s*(\\#[^\\xd\\xa]*)(.*)$/si', $this->unparsed_code, $m)) {
         $this->unparsed_code = $m[2];
     }
     if ($this->unparsed_code && !$this->getErrors()) {
         $rest = preg_replace('/[\\x0a|\\x0d]/i', ' ', substr($this->unparsed_code, 0, 30));
         $msg = trim($rest) ? 'Could not properly handle "' . $rest . '"' : 'Syntax error, probably an incomplete pattern';
         $this->addError($msg);
     }
 }
All Usage Examples Of ARC2::getRequestURI