From 5547eaa762bffa16fa07bf3d910ff53419e52b3d Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Thu, 30 Apr 2020 12:28:15 +0200 Subject: [PATCH] - Add LDC Web StatusChecker --- 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); + } +}