HttpTimeProvider
in package
implements
ITimeProvider
Takes the time from any webserver by doing a HEAD request on the specified URL and extracting the 'Date:' header
Interfaces, Classes, Traits and Enums
Table of Contents
- $expectedtimeformat : string
- $options : array<string|int, mixed>
- $url : string
- __construct() : mixed
- getTime() : int
Properties
$expectedtimeformat
public
string
$expectedtimeformat
$options
public
array<string|int, mixed>
$options
$url
public
string
$url
Methods
__construct()
public
__construct([string $url = 'https://google.com' ][, string $expectedtimeformat = 'D, d M Y H:i:s O+' ][, array<string|int, mixed> $options = null ]) : mixed
Parameters
- $url : string = 'https://google.com'
- $expectedtimeformat : string = 'D, d M Y H:i:s O+'
- $options : array<string|int, mixed> = null
Return values
mixed —getTime()
public
getTime() : int
Return values
int —the current timestamp according to this provider