mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ abstract class HeaderAbstract
|
|||
*/
|
||||
public int $status = 0;
|
||||
|
||||
public int $timestamp = 0;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
|
@ -66,6 +68,7 @@ abstract class HeaderAbstract
|
|||
public function __construct()
|
||||
{
|
||||
$this->l11n = new Localization();
|
||||
$this->timestamp = \time();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -147,6 +150,8 @@ abstract class HeaderAbstract
|
|||
*/
|
||||
abstract public function has(string $key) : bool;
|
||||
|
||||
abstract public function getRequestTime() : int;
|
||||
|
||||
/**
|
||||
* Push all headers.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ final class HttpHeader extends HeaderAbstract
|
|||
|
||||
public function getRequestTime() : int
|
||||
{
|
||||
return (int) ($_SERVER['REQUEST_TIME'] ?? \time());
|
||||
return (int) ($_SERVER['REQUEST_TIME'] ?? $this->timestamp);
|
||||
}
|
||||
|
||||
public function getRequestIp() : string
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user