From 0705abaf6e45ff02ca07254e4b764600d772987f Mon Sep 17 00:00:00 2001 From: Olivier Legat Date: Tue, 23 Feb 2021 09:17:52 +0100 Subject: [PATCH] Ajout webstatus checker --- app/Console/Commands/LDCWebStatusChecker.php | 85 ++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 app/Console/Commands/LDCWebStatusChecker.php diff --git a/app/Console/Commands/LDCWebStatusChecker.php b/app/Console/Commands/LDCWebStatusChecker.php new file mode 100644 index 0000000..fee2b72 --- /dev/null +++ b/app/Console/Commands/LDCWebStatusChecker.php @@ -0,0 +1,85 @@ + 0){ + foreach ($files as $file) { + $data['logs'] = $data['logs'] + filesize($file); + } + } + + $data['code']['version'] = app()->version(); + + // Send by cURL + $url = 'https://ldc-web.ldc.fr/api/status-checker'; + $ch = curl_init($url); + $payload = ['token' => 'CE8S52Qq7stf5k8frF4T', 'datas' => json_encode($data)]; + curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $result = curl_exec($ch); + curl_close($ch); + } +}