summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/tag/TPException.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Translate/tag/TPException.php')
-rw-r--r--www/wiki/extensions/Translate/tag/TPException.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/www/wiki/extensions/Translate/tag/TPException.php b/www/wiki/extensions/Translate/tag/TPException.php
new file mode 100644
index 00000000..b01682d6
--- /dev/null
+++ b/www/wiki/extensions/Translate/tag/TPException.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Translatable page parse exception.
+ *
+ * @file
+ * @author Niklas Laxström
+ * @copyright Copyright © 2009-2013 Niklas Laxström
+ * @license GPL-2.0-or-later
+ */
+
+/**
+ * Class to signal syntax errors in translatable pages.
+ *
+ * @ingroup PageTranslation
+ */
+class TPException extends MWException {
+ protected $msg;
+
+ /**
+ * @todo Pass around Messages when Status class doesn't suck
+ * @param array $msg Message key with parameters
+ */
+ public function __construct( array $msg ) {
+ $this->msg = $msg;
+ // Using ->plain() instead of ->text() due to bug T58226
+ $wikitext = call_user_func_array( 'wfMessage', $msg )->plain();
+ parent::__construct( $wikitext );
+ }
+
+ /**
+ * @return array
+ */
+ public function getMsg() {
+ return $this->msg;
+ }
+}