Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <?php
  2.  
  3. //Comment all the code given below
  4. //Test FTS Settings
  5. if (empty($_SESSION['setup_fts_type'])) {
  6. installLog("ERROR:: Elastic Search is required.");
  7. $errors['ERR_FTS'] = $mod_strings['LBL_FTS_REQUIRED'];
  8. } else {
  9. installLog("Begining to check FTS Settings.");
  10. $engine = SearchEngine::newEngine($_SESSION['setup_fts_type'], getFtsSettings());
  11. $ftsStatus = $engine->verifyConnectivity(false);
  12. switch ($ftsStatus) {
  13. case Client::CONN_ERROR:
  14. case Client::CONN_FAILURE:
  15. $errors['ERR_FTS'] = $mod_strings['LBL_FTS_CONN_ERROR'];
  16. installLog("ERROR:: Unable to connect to FTS." . $_SESSION['setup_fts_type']);
  17. break;
  18. case Client::CONN_NO_VERSION_AVAILABLE:
  19. $errors['ERR_FTS'] = $mod_strings['LBL_FTS_NO_VERSION_AVAILABLE'];
  20. installLog("ERROR:: No FTS version available." . $_SESSION['setup_fts_type']);
  21. break;
  22. case Client::CONN_VERSION_NOT_SUPPORTED:
  23. $errors['ERR_FTS'] = sprintf(
  24. $mod_strings['LBL_FTS_UNSUPPORTED_VERSION'],
  25. implode(', ', $engine->getContainer()->client->getAllowedVersions())
  26. );
  27. installLog("ERROR:: Unsupported version of Elastic search." . $_SESSION['setup_fts_type']);
  28. break;
  29. }
  30. installLog("FTS connection results: $ftsStatus");
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement