original_string: public function get_connection_url($path) {
          // Must use the proper protocol, or SSL will fail.
          $protocol = !empty($this->config->secure) ? 'https' : 'http';
          $url = $protocol . '://' . rtrim($this->config->server_hostname, '/');
          if (!empty($this->config->server_port)) {
              $url .= ':' . $this->config->server_port;
          }
          $url .= '/solr/' . $this->config->indexname . '/' . ltrim($path, '/');
  
          return new \moodle_url($url);
      }
code: public function get_connection_url($path) {
          // Must use the proper protocol, or SSL will fail.
          $protocol = !empty($this->config->secure) ? 'https' : 'http';
          $url = $protocol . '://' . rtrim($this->config->server_hostname, '/');
          if (!empty($this->config->server_port)) {
              $url .= ':' . $this->config->server_port;
          }
          $url .= '/solr/' . $this->config->indexname . '/' . ltrim($path, '/');
  
          return new \moodle_url($url);
      }
code_tokens: public function get_connection_url ( $ path ) { // Must use the proper protocol, or SSL will fail. $ protocol = ! empty ( $ this -> config -> secure ) ? 'https' : 'http' ; $ url = $ protocol . '://' . rtrim ( $ this -> config -> server_hostname , '/' ) ; if ( ! empty ( $ this -> config -> server_port ) ) { $ url .= ':' . $ this -> config -> server_port ; } $ url .= '/solr/' . $ this -> config -> indexname . '/' . ltrim ( $ path , '/' ) ; return new \ moodle_url ( $ url ) ; }
docstring: Return a Moodle url object for the server connection.
  
  @param string $path The solr path to append.
  @return \moodle_url
docstring_tokens: Return a Moodle url object for the server connection .