ators as they use $userinfo['lastactivity'] to determine if a user is online which relies // on this to be updated in real time. $this->registry->db->shutdown_query(" UPDATE " . TABLE_PREFIX . "user SET lastactivity = " . TIMENOW . " WHERE userid = " . $this->userinfo['userid'] . " ", 'lastvisit'); } } } } } /** * Class to handle shutdown * * @package vBulletin * @version $Revision: 1.243 $ * @author Scott * @date $Date: 2006/08/28 10:56:46 $ */ class vB_Shutdown { var $shutdown = array(); function vB_Shutdown() { } /** * Singleton emulation - use this function to instantiate the class * * @return vB_Shutdown */ function &init() { static $instance; if (!$instance) { $instance = new vB_Shutdown(); // we register this but it might not be used if (phpversion() < '5.0.5') { register_shutdown_function(array(&$instance, '__destruct')); } } return $instance; } /** * Add function to be executed at shutdown * * @param string Name of function to be executed on shutdown */ function add($function) { $obj =& vB_Shutdown::init(); if (function_exists($function) AND !in_array($function, $obj->shutdown)) { $obj->shutdown[] = $function; } } // only called when an object is destroyed, so $this is appropriate function __destruct() { if (!empty($this->shutdown)) { foreach ($this->shutdown AS $key => $funcname) { $funcname(); unset($this->shutdown[$key]); } } } } // ############################################################################# // misc functions // ############################################################################# /** * Feeds database connection errors into the halt() method of the vB_Database class. * * @param integer Error number * @param string PHP error text string * @param strig File that contained the error * @param integer Line in the file that contained the error */ function catch_db_error($errno, $errstr, $errfile, $errline) { global $db; static $failures; if (strstr($errstr, 'Lost connection') AND $failures < 5) { $failures++; return; } if (is_object($db)) { $db->halt("$errstr\r\n$errfile on line $errline"); } else { vb_error_handler($errno, $errstr, $errfile, $errline); } } // ############################################################################# /** * Removes the full path from being disclosed on any errors * * @param integer Error number * @param string PHP error text string * @param strig File that contained the error * @param integer Line in the file that contained the error */ function vb_error_handler($errno, $errstr, $errfile, $errline) { switch ($errno) { case E_WARNING: case E_USER_WARNING: /* Don't log warnings due to to the false bug reports about valid warnings that we suppress, but still appear in the log require_once(DIR . '/includes/functions_log_error.php'); $message = "Warning: $errstr in $errfile on line $errline"; log_vbulletin_error($message, 'php'); */ if (!error_reporting() OR !ini_get('display_errors')) { return; } $errfile = str_replace(DIR, '', $errfile); echo "
Warning: $errstr in $errfile on line $errline
"; break; case E_USER_ERROR: require_once(DIR . '/includes/functions_log_error.php'); $message = "Fatal error: $errstr in $errfile on line $errline"; log_vbulletin_error($message, 'php'); if (error_reporting() OR ini_get('display_errors')) { $errfile = str_replace(DIR, '', $errfile); echo "
Fatal error: $errstr in $errfile on line $errline
"; } exit; break; } } // ############################################################################# /** * Unicode-safe version of htmlspecialchars() * * @param string Text to be made html-safe * * @return string */ function htmlspecialchars_uni($text, $entities = true) { return str_replace( // replace special html characters array('<', '>', '"'), array('<', '>', '"'), preg_replace( // translates all non-unicode entities '/&(?!' . ($entities ? '#[0-9]+' : '(#[0-9]+|[a-z]+)') . ';)/si', '&', $text ) ); } /*======================================================================*\ || #################################################################### || # CVS: $RCSfile: class_core.php,v $ - $Revision: 1.243 $ || #################################################################### \*======================================================================*/ ?>
Fatal error: input in flex scanner failed in d:\appserv\www\thuyeusangnhuong\includes\functions.php on line 312