/** * Constructor. * * @throws \moodle_exception * @return void */ public function __construct() { if (!($this->config = get_config('search_solr'))) { throw new \moodle_exception('missingconfig', 'search_solr'); } if (empty($this->config->server_hostname) || empty($this->config->indexname)) { throw new \moodle_exception('missingconfig', 'search_solr'); } $this->engine = new engine(); $this->curl = $this->engine->get_curl_object(); // HTTP headers. $this->curl->setHeader('Content-type: application/json'); }