All pastes #285872 Raw Edit

Unnamed

public php v1 · immutable
#285872 ·published 2006-12-20 03:02 UTC
rendered paste body
class ZarePage {// variables	const SHOW_ERROR = 1;	const LOG_ERROR = 2;	const DISPLAY_FAIL_MSG = 4;	const SEND_EMAIL = 8;	const UNRECOVERABLE = 16;	const RECOVERABLE = 32;	// other functionspublic static function zareExceptionHandler($e) {		$flags = ($e->getCode())?$e->getCode():(self::LOG_ERROR | self::DISPLAY_FAIL_MSG | self::SEND_EMAIL | self::UNRECOVERABLE);				if ($flags & ZarePage::SHOW_ERROR)			$_SESSION['errors'][] = $e->getMessage();		if ($flags & self::DISPLAY_FAIL_MSG)			echo "There was a problem which caused an unrecoverable error.  The administrator has been notified and this will be resolved as soon as possible";				if ($flags & self::LOG_ERROR)			file_put_contents('issa-kc.org-error.log',										$err = sprintf("[%s] (%s) %s Line: %s\n  %s\n",date('Y-m-d H:i:s'),$_SERVER['REMOTE_ADDR'],$e->getFile(),$e->getLine(),$e->getMessage()),										FILE_APPEND);		if ($flags & self::SEND_EMAIL)							mail('tim.a.elliott@gmail.com','error on issa-kc.org',$err,				"From: notify@issa-kc.org\r\nReply-To: tim.a.elliott@gmail.com\r\nX-Mailer: PHP/".phpversion());						if ($flags & self::RECOVERABLE) {			header('Location: ' . ZarePage::getErrdirect());			exit;		}				if ($flags & self::UNRECOVERABLE)			exit;			}}