Skip to content

Commit

Permalink
Logging and looking for upload dir
Browse files Browse the repository at this point in the history
  • Loading branch information
pingevt committed Jan 21, 2024
1 parent 84318ee commit 9cd87c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/esm_test_lighthouse/src/Controller/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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. <pre>" . print_r($body_json, TRUE) . "</pre>");

$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. <pre>" . print_r($report_id_arr, TRUE) . "</pre> " . $result->url);

$reports = $report_storage->loadByProperties([
'id' => $report_id_arr,
Expand All @@ -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;
Expand Down

0 comments on commit 9cd87c5

Please sign in to comment.