MediaWiki REL1_32
DeferredStringifier.php
Go to the documentation of this file.
1<?php
29 private $callback;
30
32 private $params;
33
35 private $result;
36
41 public function __construct( $callback /*...*/ ) {
42 $this->params = func_get_args();
43 array_shift( $this->params );
44 $this->callback = $callback;
45 }
46
52 public function __toString() {
53 if ( $this->result === null ) {
54 $this->result = call_user_func_array( $this->callback, $this->params );
55 }
56 return $this->result;
57 }
58}
callable $callback
Callback used for result string generation.
__toString()
Get the string generated from the callback.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))