From ae43c2e6bb66a3ce65a7e64b55fe22126785db2e Mon Sep 17 00:00:00 2001 From: Emmanuel ROY Date: Wed, 9 Jun 2021 09:53:51 +0200 Subject: [PATCH] update: - bin.php frontal command --- console/component/Error.php | 3 ++- console/component/Output.php | 31 +++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/console/component/Error.php b/console/component/Error.php index 69cfe4b..406bebb 100644 --- a/console/component/Error.php +++ b/console/component/Error.php @@ -49,8 +49,9 @@ class Error } } $write_string = ob_get_clean(); - file_put_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . "output" . DIRECTORY_SEPARATOR . ENV . DIRECTORY_SEPARATOR . "errors".$date->format("Y-m-d").".log", $write_string); + file_put_contents(OUTPUT_PATH . DIRECTORY_SEPARATOR . "output" . DIRECTORY_SEPARATOR . ENV . DIRECTORY_SEPARATOR . "errors".$date->format("Y-m-d").".log", $write_string); return; } + } diff --git a/console/component/Output.php b/console/component/Output.php index ce4ba4c..de7ee8c 100644 --- a/console/component/Output.php +++ b/console/component/Output.php @@ -1,38 +1,37 @@ format('d/m/Y H:i:s') . LINE_FEED; - echo $data . LINE_FEED; - $date_fin = new \DateTime('now'); - echo "# FIN ".$date_fin->format('d/m/Y H:i:s') . LINE_FEED; + echo "# ".$date_debut->format('d/m/Y H:i') . LINE_FEED; + foreach ($agents_tab as $agent) { + echo $agent . LINE_FEED; + } + echo "# FIN ".$date_fin->format('d/m/Y H:i') . LINE_FEED; $csv_file = ob_get_clean(); - //on insère la date du jour au début du nom de fichier - $name = $date_debut->format("Y-m-d-").$name; - - file_put_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'output' . DIRECTORY_SEPARATOR . $name, $csv_file); + file_put_contents(OUTPUT_PATH . DIRECTORY_SEPARATOR . $date_debut->format('Y-m-d-') . $name, $csv_file); } }