saper has uploaded a new change for review.
https://gerrit.wikimedia.org/r/156446
Change subject: Provide rudimentary __toString() for Status
......................................................................
Provide rudimentary __toString() for Status
maintenance/eval.php is much easier to use now,
you can just print $statusInstance;
I specifically don't want to dig into "proper"
formatting of error messages, as calling getMessage()
in few places (from installer for example) gets
me in trouble with database access and what not.
Change-Id: I068b0f54b16d618a1f6115133632885e8e45e897
---
M includes/Status.php
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/46/156446/1
diff --git a/includes/Status.php b/includes/Status.php
index 1a72968..ff89d62 100644
--- a/includes/Status.php
+++ b/includes/Status.php
@@ -453,4 +453,11 @@
public function getValue() {
return $this->value;
}
+
+ /**
+ * @return string
+ */
+ public function __toString() {
+ return $this->isOK() ? "(OK)" : "(Error)";
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/156446
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I068b0f54b16d618a1f6115133632885e8e45e897
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: saper <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits