protected function getSolrConfigStore()
    {
        $options = Solr::solr_options();

        if (!isset($options['indexstore']) || !($indexstore = $options['indexstore'])) {
            throw new Exception('No index configuration for Solr provided', E_USER_ERROR);
        }

        // Find the IndexStore handler, which will handle uploading config files to Solr
        $mode = $indexstore['mode'];

        if ($mode === 'file') {
            return new SolrConfigStore_File($indexstore);
        }
        if ($mode === 'webdav') {
            return new SolrConfigStore_WebDAV($indexstore);
        }
        if ($mode === 'post') {
            return new SolrConfigStore_Post($indexstore);
        }
        if (ClassInfo::exists($mode) && ClassInfo::classImplements($mode, SolrConfigStore::class)) {
            return new $mode($indexstore);
        }
        user_error('Unknown Solr index mode ' . $indexstore['mode'], E_USER_ERROR);
    }