You are here

function fillpdf_localservice_check in FillPDF 7

Check if we can reach the FillPDF LocalService instance.

This is configured in the settings.

Parameters

string $localservice_endpoint: The FillPDF LocalService endpoint to check. If not set, check the one saved in variable fillpdf_local_service_endpoint.

Return value

bool TRUE if fillpdf_local_service_endpoint returns no error and a status of 200. FALSE otherwise.

2 calls to fillpdf_localservice_check()
FillPdfMergeTestCase::testLocalServicePdfMerging in tests/FillPdfMergeTestCase.test
Tests PDF merging using a local service.
fillpdf_settings_validate in ./fillpdf.admin.inc

File

./fillpdf.module, line 2108

Code

function fillpdf_localservice_check($localservice_endpoint = NULL) {

  // Check for NULL, because an empty string being passed in should fail.
  if (is_null($localservice_endpoint)) {
    $localservice_endpoint = variable_get('fillpdf_local_service_endpoint');
  }
  $response = drupal_http_request($localservice_endpoint);
  return empty($response->error) && $response->code == 200;
}