| 1 |
<?php |
| 2 |
|
| 3 |
use MediaWiki\Config\ServiceOptions; |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
class LoggedServiceOptions extends ServiceOptions { |
| 9 |
|
| 10 |
private $accessLog; |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
public function __construct( array &$accessLog, array $keys, ...$args ) { |
| 19 |
$this->accessLog = &$accessLog; |
| 20 |
if ( !$accessLog ) { |
| 21 |
$accessLog = [ $keys, [] ]; |
| 22 |
} |
| 23 |
|
| 24 |
parent::__construct( $keys, ...$args ); |
| 25 |
} |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
public function get( $key ) { |
| 32 |
$this->accessLog[1][$key] = true; |
| 33 |
|
| 34 |
return parent::get( $key ); |
| 35 |
} |
| 36 |
} |