Example #1
0
 /**
  * Can setup be executed against the configured server.
  *
  * @return true|string True or error message.
  */
 public function can_setup_server()
 {
     $engine = new \search_solr\engine();
     $status = $engine->is_server_configured();
     if ($status !== true) {
         return $status;
     }
     // We know that the server is ready here.
     if ($engine->get_solr_major_version() < 5) {
         // Schema setup script only available for 5.0 onwards.
         return get_string('schemasetupfromsolr5', 'search_solr');
     }
     return true;
 }
Example #2
0
 /**
  * Can setup be executed against the configured server.
  *
  * @return true|string True or error message.
  */
 public function can_setup_server()
 {
     $engine = new \search_solr\engine();
     $status = $engine->is_server_configured();
     if ($status !== true) {
         return $status;
     }
     // At this stage we know that the server is properly configured with a valid host:port and indexname.
     // We're not too concerned about repeating the SolrClient::system() call (already called in
     // is_server_configured) because this is just a setup script.
     if ($engine->get_solr_major_version() < 5) {
         // Schema setup script only available for 5.0 onwards.
         return get_string('schemasetupfromsolr5', 'search_solr');
     }
     return true;
 }