You are here

public function PantheonSolrConnector::pingServer in Search API Pantheon 8

1 call to PantheonSolrConnector::pingServer()
PantheonSolrConnector::getDataFromHandler in src/Plugin/SolrConnector/PantheonSolrConnector.php

File

src/Plugin/SolrConnector/PantheonSolrConnector.php, line 173
Provide a connection to Pantheon's Solr instance.

Class

PantheonSolrConnector
Standard Solr connector.

Namespace

Drupal\search_api_pantheon\Plugin\SolrConnector

Code

public function pingServer() {

  // The path used in the parent class, admin/info/system, fails.
  // I don't know why.
  $ping = $this
    ->doPing([
    'handler' => 'admin/system',
  ], 'server');

  // If the ping fails, there is a good chance it is because the code
  // is being run on a new multidev environment in which the schema has not
  // yet been posted.
  if ($ping === FALSE) {
    $this
      ->postSchema();

    // Try again after posting the schema.
    return $this
      ->doPing([
      'handler' => 'admin/system',
    ], 'server');
  }
  else {
    return $ping;
  }
}