This commit is contained in:
Jephté Clain 2025-02-18 11:48:06 +04:00
parent 1ddd24379b
commit 6817a7c0b0
2 changed files with 5 additions and 5 deletions

View File

@ -5,4 +5,4 @@ RUNPHP=
# Si RUNPHP n'est pas défini, les variables suivantes peuvent être définies
DIST=d11
#REGISTRY=pubdocker.univ-reunion.fr
#REGISTRY=pubdocker.univ-reunion.fr/dist

View File

@ -65,19 +65,19 @@ class http {
/** rediriger vers l'url spécifiée et arrêter le script immédiatement */
static function redirect(string $url, bool $exit_now=true): void {
header("Location: $url");
if ($exit_now) exit;
if ($exit_now) exit();
}
/** rafraichir vers l'url spécifiée et arrêter le script immédiatement */
static function refresh(string $url, int $delay=1, bool $exit_now=true): void {
header("Refresh: $delay; url=$url");
if ($exit_now) exit;
if ($exit_now) exit();
}
/** envoyer le status "pas de contenu" et arrêter le script immédiatement */
static function send_no_content(bool $exit_now=true): void {
header("HTTP/1.1 204 No Content");
if ($exit_now) exit;
if ($exit_now) exit();
}
/**
@ -109,7 +109,7 @@ class http {
# XXX si $written !== $size, il faudrait agir en conséquence...
fclose($fd);
if ($written === false) return false;
if ($exit_now) exit;
if ($exit_now) exit();
return true;
}