⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 error.class

📁 GForge 3.0 协作开发平台 支持CVS, mailing lists, bug tracking, message boards/forums, task management, perman
💻 CLASS
字号:
<?php   /** * A very base error class. * * Provides a basic uniform API for setting and testing error conditions and * error messages. * * @version   $Id: Error.class,v 1.3 2001/06/06 21:30:03 dbrogdon Exp $ * @author Tim Perdue <tperdue@valnux.com> * @date 2000-08-28 * * This file is part of GForge. * * GForge is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GForge is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GForge; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */class Error {	/**	 * The current error state.	 *	 * @var bool $error_state.	 */	var $error_state;	/**	 * The current error message(s).	 *	 * @var string $error_message.	 */	var $error_message;	/**	 * Error() - Constructor.	 * Constructor for the Error class.	 * Sets the error state to false.	 *	 */	function Error() {		//nothing		$this->error_state=false;	}	/**	 * setError() - Sets the error string.	 * Set the error string $error_message to the value of $string	 # and enable the $error_state flag.	 *	 * @param	string  The error string to set.	 *	 */	function setError($string) {		$this->error_state=true;		$this->error_message=$string;	}	/**	 * clearError() - Clear the current error.	 * Clear the current error string and disable the $error_state flag.	 *	 */	function clearError() {		$this->error_state=false;		$this->error_message='';	}	/**	 * getErrorMessage() - Retrieve the error message string.	 * Returns the value of $error_message.	 *	 * @return    $error_message The current error message string.	 *	 */	function getErrorMessage() {		if ($this->error_state)	{			return $this->error_message;		} else {			return 'No Error';		}	}	/**	 * isError() - Determines the current error state.	 * This function returns the current value of $error_state.	 *	 * @return    $error_state     The boolean error status.	 *	 */	function isError() {		return $this->error_state;	}		/**	 * setPermissionDeniedError() - sets a Permission Denied error	 *  retrieves the localized error string for Permission Denied and calls exit_error()	 *	 *	 */	function setPermissionDeniedError(){		global $Language;		exit_error($Language->getText('general','error'),$Language->getText('general','permdenied'));	}	/**	 * setInvalidEmailError() - sets a Invalid Email error	 *  retrieves the localized error string for Invalid Email and calls exit_error()	 *	 *	 */	function setInvalidEmailError(){		global $Language;		exit_error($Language->getText('general','error'),$Language->getText('general','invalid_email'));	}		/**	 * setOnUpdateError() - sets an On Update Error	 *  retrieves the localized error string for On Update and calls exit_error()	 *	 * 	 * @param	string  The db result to be written.	 *	 */		function setOnUpdateError($result=""){		global $Language;		exit_error($Language->getText('general','error'),$Language->getText('general','error_on_update',$result));			}	/**	 * setGroupIdError() - sets an Group ID Error	 *  retrieves the localized error string for Group ID and calls exit_error()	 *	 *	 */	function setGroupIdError(){		global $Language;		exit_error($Language->getText('general','error'),$Language->getText('general','error_group_id'));			}	/**	 * setMissingParamsError() - sets an Group ID Error	 *  retrieves the localized error string for missing pparamsand calls exit_error()	 *	 *	 */	function setMissingParamsError(){		global $Language;		exit_error($Language->getText('general','error'),$Language->getText('general','error_missing_params'));			}}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -