Add a Request::time() function.

This commit is contained in:
Franz Liedke 2012-07-10 15:29:26 +03:00
parent ebcbbbb843
commit 204a6a7980
1 changed files with 19 additions and 0 deletions

View File

@ -177,6 +177,25 @@ public static function referrer()
{
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.