dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Fixed $wgProfileToDatabase/$wgProfileCallTree interaction (later disabled the former)
[lhc/web/wiklou.git]
/
includes
/
WikiError.php
diff --git
a/includes/WikiError.php
b/includes/WikiError.php
index
efb645b
..
251c174
100644
(file)
--- 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...
/**
* Since PHP4 doesn't have exceptions, here's some error objects
* loosely modeled on the standard PEAR_Error model...
- * @
addto
group Exception
+ * @
in
group Exception
*/
class WikiError {
/**
*/
class WikiError {
/**
- * @param
string $message
+ * @param
$message string
*/
function __construct( $message ) {
$this->mMessage = $message;
*/
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.
*
* Returns true if the given object is a WikiError-descended
* error object, false otherwise.
*
- * @param
mixed $object
+ * @param
$object mixed
* @return bool
* @return bool
- * @static
*/
public static function isError( $object ) {
return $object instanceof WikiError;
*/
public static function isError( $object ) {
return $object instanceof WikiError;
@@
-65,28
+64,41
@@
class WikiError {
/**
* Localized error message object
/**
* Localized error message object
- * @
addto
group Exception
+ * @
in
group Exception
*/
class WikiErrorMsg extends WikiError {
/**
*/
class WikiErrorMsg extends WikiError {
/**
- * @param
string $message W
iki message name
+ * @param
$message String: w
iki message name
* @param ... parameters to pass to wfMsg()
*/
function WikiErrorMsg( $message/*, ... */ ) {
$args = func_get_args();
array_shift( $args );
$this->mMessage = wfMsgReal( $message, $args, true );
* @param ... parameters to pass to wfMsg()
*/
function WikiErrorMsg( $message/*, ... */ ) {
$args = func_get_args();
array_shift( $args );
$this->mMessage = wfMsgReal( $message, $args, true );
+ $this->mMsgKey = $message;
+ $this->mMsgArgs = $args;
+ }
+
+ function getMessageKey() {
+ return $this->mMsgKey;
+ }
+
+ function getMessageArgs() {
+ return $this->mMsgArgs;
}
}
/**
}
}
/**
- * @todo document
- * @addtogroup Exception
+ * Error class designed to handle errors involved with
+ * XML parsing
+ * @ingroup Exception
*/
class WikiXmlError extends WikiError {
/**
*/
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 );
*/
function WikiXmlError( $parser, $message = 'XML parsing error', $context = null, $offset = 0 ) {
$this->mXmlError = xml_get_error_code( $parser );
@@
-101,12
+113,12
@@
class WikiXmlError extends WikiError {
/** @return string */
function getMessage() {
/** @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->mMessage,
$this->mLine,
$this->mColumn,
- $this->mByte,
- $this->mContext,
+ $this->mByte . $this->mContext,
xml_error_string( $this->mXmlError ) );
}
xml_error_string( $this->mXmlError ) );
}
@@
-120,5
+132,3
@@
class WikiXmlError extends WikiError {
}
}
}
}
}
}
-
-