From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- includes/libs/DeferredStringifier.php | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 includes/libs/DeferredStringifier.php (limited to 'includes/libs/DeferredStringifier.php') diff --git a/includes/libs/DeferredStringifier.php b/includes/libs/DeferredStringifier.php new file mode 100644 index 00000000..a6fd11a4 --- /dev/null +++ b/includes/libs/DeferredStringifier.php @@ -0,0 +1,57 @@ +params = func_get_args(); + array_shift( $this->params ); + $this->callback = $callback; + } + + /** + * Get the string generated from the callback + * + * @return string + */ + public function __toString() { + if ( $this->result === null ) { + $this->result = call_user_func_array( $this->callback, $this->params ); + } + return $this->result; + } +} -- cgit v1.2.3-54-g00ecf