original_string: public function getUrlParams()
      {
          if ($this->_urlParams === null) {
              $pa = @parse_url($this->getUrl());
              $pa['scheme'] = isset($pa['scheme']) ? strtolower($pa['scheme']) : 'http';
              if ($pa['scheme'] !== 'http' && $pa['scheme'] !== 'https') {
                  return false;
              }
              if (!isset($pa['host'])) {
                  return false;
              }
              if (!isset($pa['path'])) {
                  $pa['path'] = '/';
              }
              // basic auth
              if (isset($pa['user']) && isset($pa['pass'])) {
                  $this->applyBasicAuth($pa['user'], $pa['pass']);
              }
              // convert host to IP address
              $port = isset($pa['port']) ? intval($pa['port']) : ($pa['scheme'] === 'https' ? 443 : 80);
              $pa['ip'] = $this->hasHeader('x-server-ip') ?
                  $this->getHeader('x-server-ip') : self::getIp($pa['host']);
              $pa['conn'] = ($pa['scheme'] === 'https' ? 'ssl' : 'tcp') . '://' . $pa['ip'] . ':' . $port;
              // host header
              if (!$this->hasHeader('host')) {
                  $this->setHeader('host', strtolower($pa['host']));
              } else {
                  $pa['host'] = $this->getHeader('host');
              }
              $this->_urlParams = $pa;
          }
          return $this->_urlParams;
      }
code: public function getUrlParams()
      {
          if ($this->_urlParams === null) {
              $pa = @parse_url($this->getUrl());
              $pa['scheme'] = isset($pa['scheme']) ? strtolower($pa['scheme']) : 'http';
              if ($pa['scheme'] !== 'http' && $pa['scheme'] !== 'https') {
                  return false;
              }
              if (!isset($pa['host'])) {
                  return false;
              }
              if (!isset($pa['path'])) {
                  $pa['path'] = '/';
              }
              // basic auth
              if (isset($pa['user']) && isset($pa['pass'])) {
                  $this->applyBasicAuth($pa['user'], $pa['pass']);
              }
              // convert host to IP address
              $port = isset($pa['port']) ? intval($pa['port']) : ($pa['scheme'] === 'https' ? 443 : 80);
              $pa['ip'] = $this->hasHeader('x-server-ip') ?
                  $this->getHeader('x-server-ip') : self::getIp($pa['host']);
              $pa['conn'] = ($pa['scheme'] === 'https' ? 'ssl' : 'tcp') . '://' . $pa['ip'] . ':' . $port;
              // host header
              if (!$this->hasHeader('host')) {
                  $this->setHeader('host', strtolower($pa['host']));
              } else {
                  $pa['host'] = $this->getHeader('host');
              }
              $this->_urlParams = $pa;
          }
          return $this->_urlParams;
      }
code_tokens: public function getUrlParams ( ) { if ( $ this -> _urlParams === null ) { $ pa = @ parse_url ( $ this -> getUrl ( ) ) ; $ pa [ 'scheme' ] = isset ( $ pa [ 'scheme' ] ) ? strtolower ( $ pa [ 'scheme' ] ) : 'http' ; if ( $ pa [ 'scheme' ] !== 'http' && $ pa [ 'scheme' ] !== 'https' ) { return false ; } if ( ! isset ( $ pa [ 'host' ] ) ) { return false ; } if ( ! isset ( $ pa [ 'path' ] ) ) { $ pa [ 'path' ] = '/' ; } // basic auth if ( isset ( $ pa [ 'user' ] ) && isset ( $ pa [ 'pass' ] ) ) { $ this -> applyBasicAuth ( $ pa [ 'user' ] , $ pa [ 'pass' ] ) ; } // convert host to IP address $ port = isset ( $ pa [ 'port' ] ) ? intval ( $ pa [ 'port' ] ) : ( $ pa [ 'scheme' ] === 'https' ? 443 : 80 ) ; $ pa [ 'ip' ] = $ this -> hasHeader ( 'x-server-ip' ) ? $ this -> getHeader ( 'x-server-ip' ) : self :: getIp ( $ pa [ 'host' ] ) ; $ pa [ 'conn' ] = ( $ pa [ 'scheme' ] === 'https' ? 'ssl' : 'tcp' ) . '://' . $ pa [ 'ip' ] . ':' . $ port ; // host header if ( ! $ this -> hasHeader ( 'host' ) ) { $ this -> setHeader ( 'host' , strtolower ( $ pa [ 'host' ] ) ) ; } else { $ pa [ 'host' ] = $ this -> getHeader ( 'host' ) ; } $ this -> _urlParams = $ pa ; } return $ this -> _urlParams ; }
docstring: Get url parameters
  @return array the parameters parsed from URL, or false on error
docstring_tokens: Get url parameters