Mailing_client, indes/tools, les deux fichiers lang

This commit is contained in:
Oleg Barykin committed 2026-03-22 16:42:06 +01:00
1 parent f852c0516a
commit 865de8a976
5 files changed
+513 -7

No files matched your search

+7 -7
View File
@@ -1,5 +1,5 @@
<?php
declare(strict_types=1);
declare (strict_types = 1);
header('Content-Type: text/plain; charset=UTF-8');
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
@@ -12,23 +12,23 @@ ini_set('error_log', __DIR__ . '/webcron_error.log');
// ===== sécurité =====
const CRON_TOKEN = 'e3e6ba5785a447c3f763a4ca4b8c36480df63a19';
if (!hash_equals(CRON_TOKEN, $_GET['token'] ?? '')) {
if (! hash_equals(CRON_TOKEN, $_GET['token'] ?? '')) {
http_response_code(403);
exit("forbidden\n");
}
// ===== anti double exécution =====
$lockFile = __DIR__ . '/cron.lock';
$lock = fopen($lockFile, 'c');
if (!$lock || !flock($lock, LOCK_EX | LOCK_NB)) {
$lock = fopen($lockFile, 'c');
if (! $lock || ! flock($lock, LOCK_EX | LOCK_NB)) {
exit("already running\n");
}
// ===== log minimal =====
file_put_contents(__DIR__ . '/webcron.log', date('Y-m-d H:i:s') . " run\n", FILE_APPEND);
file_put_contents(__DIR__ . '/webcron.log', date('Y-m-d H:i:s') . " before worker\n", FILE_APPEND);
// ===== lance ton worker =====
require __DIR__ . '/worker.php';
echo "OK\n";
file_put_contents(__DIR__ . '/webcron.log', date('Y-m-d H:i:s') . " after worker\n", FILE_APPEND);
echo "OK\n";