From b53ef993462c95d15d240f31b7b0f9ffd0ee8db6 Mon Sep 17 00:00:00 2001 From: Mark Jordan Date: Mon, 5 Jul 2021 18:18:50 +0000 Subject: [PATCH] WIP on #46. --- islandora_riprap.install | 73 ---------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 islandora_riprap.install diff --git a/islandora_riprap.install b/islandora_riprap.install deleted file mode 100644 index 4c213aa..0000000 --- a/islandora_riprap.install +++ /dev/null @@ -1,73 +0,0 @@ -get('riprap_mode'); - - // If using Riprap as a remote microserive, - // check whether Riprap's endpoint is available. - if ($mode == 'remote') { - $riprap_endpoint = $config->get('riprap_rest_endpoint'); - - $riprap_response_code = 0; - try { - $client = \Drupal::httpClient(); - // Assumes Riprap requires no authentication - // (e.g., it's behind the Symfony or other firewall). - $response = $client->request('HEAD', $riprap_endpoint); - $riprap_response_code = $response->getStatusCode(); - } - catch (Exception $e) { - \Drupal::logger('islandora_riprap')->error($e->getMessage()); - } - finally { - if ($riprap_response_code == 200) { - $requirements['islandora_riprap_microservice_available'] = [ - 'title' => t("Islandora Riprap"), - 'description' => t("Riprap is running at @endpoint. @chart_link.", ['@endpoint' => $riprap_endpoint, '@chart_link' => $riprap_utils->getLinkToFailedFixityEventsReport()]), - 'severity' => REQUIREMENT_INFO, - ]; - } - else { - $requirements['islandora_riprap_microservice_available'] = [ - 'title' => t("Islandora Riprap"), - 'description' => t("Riprap not found or is not running at @endpoint", ['@endpoint' => $riprap_endpoint]), - 'severity' => REQUIREMENT_ERROR, - ]; - } - } - } - - if ($mode == 'local') { - $riprap_directory = $config->get('riprap_local_directory'); - if (file_exists($riprap_directory)) { - $requirements['riprap_directory_exists'] = [ - 'title' => t("Islandora Riprap"), - 'description' => t("Riprap is installed at @directory. @chart_link.", ['@directory' => $riprap_directory, '@chart_link' => $riprap_utils->getLinkToFailedFixityEventsReport()]), - 'severity' => REQUIREMENT_INFO, - ]; - } - else { - $requirements['riprap_directory_exists'] = [ - 'title' => t("Islandora Riprap"), - 'description' => t("Riprap is not installed at @directory", ['@directory' => $riprap_directory]), - 'severity' => REQUIREMENT_ERROR, - ]; - } - } - } - - return $requirements; -}