X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FWikiError.php;h=c5082004da62f395b2f1bebbaba5aebb07a9f6ef;hb=75b58962c6b1fa158c31019e8b7d13453d11dddd;hp=064db61a765f4867b9e759f33dd61cf97a0d05a9;hpb=f9619da3f02b4759ae92250c483d4bf14dfd9ee8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WikiError.php b/includes/WikiError.php index 064db61a76..c5082004da 100644 --- a/includes/WikiError.php +++ b/includes/WikiError.php @@ -24,11 +24,11 @@ /** * Since PHP4 doesn't have exceptions, here's some error objects * loosely modeled on the standard PEAR_Error model... - * @addtogroup Exception + * @ingroup Exception */ class WikiError { /** - * @param string $message + * @param $message string */ function __construct( $message ) { $this->mMessage = $message; @@ -54,9 +54,8 @@ class WikiError { * Returns true if the given object is a WikiError-descended * error object, false otherwise. * - * @param mixed $object + * @param $object mixed * @return bool - * @static */ public static function isError( $object ) { return $object instanceof WikiError; @@ -65,11 +64,11 @@ class WikiError { /** * Localized error message object - * @addtogroup Exception + * @ingroup Exception */ class WikiErrorMsg extends WikiError { /** - * @param string $message Wiki message name + * @param $message String: wiki message name * @param ... parameters to pass to wfMsg() */ function WikiErrorMsg( $message/*, ... */ ) { @@ -81,12 +80,14 @@ class WikiErrorMsg extends WikiError { /** * @todo document - * @addtogroup Exception + * @ingroup Exception */ class WikiXmlError extends WikiError { /** - * @param resource $parser - * @param string $message + * @param $parser resource + * @param $message string + * @param $context + * @param $offset Int */ function WikiXmlError( $parser, $message = 'XML parsing error', $context = null, $offset = 0 ) { $this->mXmlError = xml_get_error_code( $parser ); @@ -101,12 +102,12 @@ class WikiXmlError extends WikiError { /** @return string */ function getMessage() { - return sprintf( '%s at line %d, col %d (byte %d%s): %s', + // '$1 at line $2, col $3 (byte $4): $5', + return wfMsgHtml( 'xml-error-string', $this->mMessage, $this->mLine, $this->mColumn, - $this->mByte, - $this->mContext, + $this->mByte . $this->mContext, xml_error_string( $this->mXmlError ) ); } @@ -120,5 +121,3 @@ class WikiXmlError extends WikiError { } } } - -?>