original_string: protected function _constructBaseUrl($servlet, $params = array())
      {
          if (count($params))
          {
              //escape all parameters appropriately for inclusion in the query string
              $escapedParams = array();
  
              foreach ($params as $key => $value)
              {
                  $escapedParams[] = urlencode($key) . '=' . urlencode($value);
              }
  
              $queryString = $this->_queryDelimiter . implode($this->_queryStringDelimiter, $escapedParams);
          }
          else
          {
              $queryString = '';
          }
          
          if (!$this->_basePath) {
              throw new Exception('Please provide a base path');
          }
  
          $protocol = 'http://';
          if ($this->_useHttps) {
              $protocol = 'https://';
          }
          return $protocol . $this->_host . ':' . $this->_port . $this->_basePath . $servlet . $queryString;
      }
code: protected function _constructBaseUrl($servlet, $params = array())
      {
          if (count($params))
          {
              //escape all parameters appropriately for inclusion in the query string
              $escapedParams = array();
  
              foreach ($params as $key => $value)
              {
                  $escapedParams[] = urlencode($key) . '=' . urlencode($value);
              }
  
              $queryString = $this->_queryDelimiter . implode($this->_queryStringDelimiter, $escapedParams);
          }
          else
          {
              $queryString = '';
          }
          
          if (!$this->_basePath) {
              throw new Exception('Please provide a base path');
          }
  
          $protocol = 'http://';
          if ($this->_useHttps) {
              $protocol = 'https://';
          }
          return $protocol . $this->_host . ':' . $this->_port . $this->_basePath . $servlet . $queryString;
      }
code_tokens: protected function _constructBaseUrl ( $ servlet , $ params = array ( ) ) { if ( count ( $ params ) ) { //escape all parameters appropriately for inclusion in the query string $ escapedParams = array ( ) ; foreach ( $ params as $ key => $ value ) { $ escapedParams [ ] = urlencode ( $ key ) . '=' . urlencode ( $ value ) ; } $ queryString = $ this -> _queryDelimiter . implode ( $ this -> _queryStringDelimiter , $ escapedParams ) ; } else { $ queryString = '' ; } if ( ! $ this -> _basePath ) { throw new Exception ( 'Please provide a base path' ) ; } $ protocol = 'http://' ; if ( $ this -> _useHttps ) { $ protocol = 'https://' ; } return $ protocol . $ this -> _host . ':' . $ this -> _port . $ this -> _basePath . $ servlet . $ queryString ; }
docstring: Return a valid http URL given this server's host, port and path and a provided servlet name
  Exclude core name from
  
  @param string $servlet
  @param array $params
  @return string
  @throws Exception
docstring_tokens: Return a valid http URL given this server s host port and path and a provided servlet name Exclude core name from