Esempio n. 1
0
 /**
  * Constructor
  *
  * @param $searchHandler string The search handler URL. We assume the embedded server
  *  as a default.
  * @param $username string The HTTP BASIC authentication username.
  * @param $password string The corresponding password.
  * @param $instId string The unique ID of this OJS installation to partition
  *  a shared index.
  *  @param $useProxy boolean Whether the proxy settings from config.inc.php should be considered.
  */
 function __construct($searchHandler, $username, $password, $instId, $useProxy = false)
 {
     parent::__construct();
     // Configure the web service.
     $this->setAuthUsername($username);
     $this->setAuthPassword($password);
     // Remove trailing slashes.
     assert(is_string($searchHandler) && !empty($searchHandler));
     $searchHandler = rtrim($searchHandler, '/');
     // Parse the search handler URL.
     $searchHandlerParts = explode('/', $searchHandler);
     $this->_solrSearchHandler = array_pop($searchHandlerParts);
     $this->_solrCore = array_pop($searchHandlerParts);
     $this->_solrServer = implode('/', $searchHandlerParts) . '/';
     // Set the installation ID.
     assert(is_string($instId) && !empty($instId));
     $this->_instId = $instId;
     $this->_useProxySettings = $useProxy;
 }