protected function getAbTesting() { if (empty($this->abTesting)) { $this->abTesting = AbTesting::getInstance(); } return $this->abTesting; }
static function getInstance() { if (is_null(self::$instance)) { self::$instance = new AbTesting(); } return self::$instance; }
function __construct() { parent::__construct(); if (!self::$initialized) { // Nirvana singleton, please use F::build F::setInstance(__CLASS__, $this); self::$initialized = true; } }
<?php /** @var $abTesting AbTesting */ $abTesting = AbTesting::getInstance(); $yes = wfMsg('abtesting-flag-set-short'); ?> <tr class="exp<?php echo empty($showDetails) ? ' collapsed' : ''; ?> " data-id="<?php echo $experiment['id']; ?> "> <td class="arrow-nav"><img class="arrow" src="<?php echo $wg->BlankImgUrl; ?> " /></td> <td><?php echo $experiment['id']; ?> </td> <td class="<?php echo $experiment['css_class']; ?> "><?php echo htmlspecialchars($experiment['name']); ?> </td> <td><?php echo htmlspecialchars($experiment['description']); ?>