/**
  * Return a instance of SearchService.
  * @return SearchService Instance of SearchService
  */
 public static function getInstance()
 {
     wfProfileIn('BS::' . __METHOD__);
     if (self::$oInstance === null) {
         if (PHP_SAPI === 'cli') {
             $oDbr = wfGetDB(DB_SLAVE);
             if ($oDbr->tableExists('bs_settings')) {
                 BsConfig::loadSettings();
             }
         }
         $aUrl = parse_url(BsConfig::get('MW::ExtendedSearch::SolrServiceUrl'));
         if (empty($aUrl['host']) || empty($aUrl['port']) || empty($aUrl['path'])) {
             wfProfileOut('BS::' . __METHOD__);
             throw new Exception('Creating instance of ' . __CLASS__ . ' not possible with these params:' . ', $host=' . (isset($aUrl['host']) ? $aUrl['host'] : '') . ', $port=' . (isset($aUrl['port']) ? $aUrl['port'] : '') . ', $path=' . (isset($aUrl['path']) ? $aUrl['path'] : ''));
         }
         $oServer = new self($aUrl['scheme'], $aUrl['host'], $aUrl['port'], $aUrl['path']);
         self::$oInstance = $oServer;
         wfProfileOut('BS::' . __METHOD__);
         return $oServer;
     }
     wfProfileOut('BS::' . __METHOD__);
     return self::$oInstance;
 }