Add a Request::time() function.
This commit is contained in:
parent
ebcbbbb843
commit
204a6a7980
|
@ -178,6 +178,25 @@ public static function referrer()
|
||||||
return static::foundation()->headers->get('referer');
|
return static::foundation()->headers->get('referer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the timestamp of the time when the request was started.
|
||||||
|
*
|
||||||
|
* The value is actually calculated when this function gets first called.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public static function time()
|
||||||
|
{
|
||||||
|
static $time;
|
||||||
|
|
||||||
|
if (!isset($time))
|
||||||
|
{
|
||||||
|
$time = time();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $time;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if the current request is via the command line.
|
* Determine if the current request is via the command line.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue