From 9cd87c530f8067ff10dc18fd76cc536f6a060ca0 Mon Sep 17 00:00:00 2001 From: Pete Inge Date: Sat, 20 Jan 2024 23:00:15 -0500 Subject: [PATCH] Logging and looking for upload dir --- modules/esm_test_lighthouse/src/Controller/Api.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/esm_test_lighthouse/src/Controller/Api.php b/modules/esm_test_lighthouse/src/Controller/Api.php index 56716a7..28ede33 100644 --- a/modules/esm_test_lighthouse/src/Controller/Api.php +++ b/modules/esm_test_lighthouse/src/Controller/Api.php @@ -93,13 +93,15 @@ public function lighthouseResults(Request $request) { $report_id_arr = explode("+", $body_json->id_string); - $this->loggerFactory->get('esm:lighthouse')->debug("Recieved Lighthouse results. " . print_r($body_json, TRUE)); + $this->loggerFactory->get('esm:lighthouse')->debug("Recieved Lighthouse results.
" . print_r($body_json, TRUE) . "
"); $report_storage = $this->entityTypeManager->getStorage('result'); + $target_dir = $body_json->dir; + foreach ($body_json->results as $i => $result) { - $this->loggerFactory->get('esm:lighthouse')->debug("Attempting to find Reports. " . print_r($report_id_arr, TRUE) . " " . $result->url); + $this->loggerFactory->get('esm:lighthouse')->debug("Attempting to find Reports.
" . print_r($report_id_arr, TRUE) . "
" . $result->url); $reports = $report_storage->loadByProperties([ 'id' => $report_id_arr, @@ -124,7 +126,7 @@ public function lighthouseResults(Request $request) { $json_filename = explode(".lighthouseci/", $result->jsonPath)[1]; $time = $this->getDateTimeFromEntity($report); - $target_dir = $config->get('dir') . "/" . $time->format("Ymd-His"); + // $target_dir = $config->get('dir') . "/" . $time->format("Ymd-His"); $target_html_file = $target_dir . "/" . $html_filename; $target_json_file = $target_dir . "/" . $json_filename;