[TYPO3-dev] Time issues - a proposal

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Fri Oct 26 23:38:53 CEST 2007


Hi!

I want to introduce a new variable to be used for access control. It 
drops the seconds from the current time as access control doesn't use 
seconds. The point is to give Mysql the chance to cache the query, which 
  is nearly impossible with clauses like "endtime > 
$GLOBALS['SIM_EXEC_TIME']".

$ACCESS_TIME = $EXEC_TIME - ($EXEC_TIME % 60);
$SIM_ACCESS_TIME = $SIM_ACCESS_TIME;

And I want a new option to store all timestamps in UTC/GMT. Therefor 
t3lib_div gets two new functions.

function getTime()	{
	if ($GLOBALS['TYPO3_CONF_VAR']['SYS']['useUTC'])	{
		$time = gmtime();
	} else {
		$time = time();
	}
}

function makeTime()	{
	$args = func_get_args();

	if ($GLOBALS['TYPO3_CONF_VAR']['SYS']['useUTC'])	{
		return call_user_func_array('gmmktime', $args);
	} else {
		return call_user_func_array('mktime', $args);
	}
}

Masi




More information about the TYPO3-dev mailing list