Solved: 7 Years ago Call to undefined function format_time_duration() and db_mysqli.php
#7
Solved: 7 Years ago
bump, I'm also seeing this A LOT in my error logs. I'm running MySQLi 5.6.19

[Fri Jan 23 00:46:39.941069 2015] [:error] [pid 768] [client IP Address] FastCGI: server "/some/path" stderr: PHP Fatal error:  Call to undefined function format_time_duration() in /inc/db_mysqli.php on line 229

line 3658 is different in inc/functions.php as referenced above, I imagine since that was posted months ago.

I do have the bit posted by niere8 here around 3683:

/**
 * Format a decimal number in to microseconds, milliseconds, or seconds.
 *
 * @param int The time in microseconds
 * @return string The friendly time duration
 */
function format_time_duration($time)
{
	global $lang;

	if(!is_numeric($time))
	{
		return $lang->na;
	}

	if(round(1000000 * $time, 2) < 1000)
	{
		$time = number_format(round(1000000 * $time, 2))." μs";
	}
	elseif(round(1000000 * $time, 2) >= 1000 && round(1000000 * $time, 2) < 1000000)
	{
		$time = number_format(round((1000 * $time), 2))." ms";
	}
	else
	{
		$time = round($time, 3)." seconds";
	}

	return $time;
}
Reply


Messages In This Thread
RE: Call to undefined function format_time_duration() and db_mysqli.php - by andrewjs18 - 2015-01-23, 08:36 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)