mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-04 19:58:39 +00:00
add header timestamp
This commit is contained in:
parent
0844846f51
commit
11d2ed8f2e
|
|
@ -159,6 +159,11 @@ final class CliHeader extends HeaderAbstract
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getRequestTime() : int
|
||||||
|
{
|
||||||
|
return $this->timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate predefined header.
|
* Generate predefined header.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,8 @@ abstract class HeaderAbstract
|
||||||
*/
|
*/
|
||||||
public int $status = 0;
|
public int $status = 0;
|
||||||
|
|
||||||
|
public int $timestamp = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
|
@ -66,6 +68,7 @@ abstract class HeaderAbstract
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->l11n = new Localization();
|
$this->l11n = new Localization();
|
||||||
|
$this->timestamp = \time();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -147,6 +150,8 @@ abstract class HeaderAbstract
|
||||||
*/
|
*/
|
||||||
abstract public function has(string $key) : bool;
|
abstract public function has(string $key) : bool;
|
||||||
|
|
||||||
|
abstract public function getRequestTime() : int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Push all headers.
|
* Push all headers.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ final class HttpHeader extends HeaderAbstract
|
||||||
|
|
||||||
public function getRequestTime() : int
|
public function getRequestTime() : int
|
||||||
{
|
{
|
||||||
return (int) ($_SERVER['REQUEST_TIME'] ?? \time());
|
return (int) ($_SERVER['REQUEST_TIME'] ?? $this->timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRequestIp() : string
|
public function getRequestIp() : string
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user