Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
LogAdminActionJob | |
0.00% |
0 / 11 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
run | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\SecurePoll\Jobs; |
4 | |
5 | use Job; |
6 | use MediaWiki\Extension\SecurePoll\Context; |
7 | |
8 | /** |
9 | * Log whenever an admin looks at Special:SecurePoll/list/{id} |
10 | */ |
11 | class LogAdminActionJob extends Job { |
12 | /** |
13 | * @inheritDoc |
14 | */ |
15 | public function __construct( $title, $params ) { |
16 | parent::__construct( 'securePollLogAdminAction', $title, $params ); |
17 | } |
18 | |
19 | /** |
20 | * @return bool |
21 | */ |
22 | public function run() { |
23 | $context = new Context(); |
24 | $dbw = $context->getDB( DB_PRIMARY ); |
25 | $fields = $this->params['fields']; |
26 | $fields['spl_timestamp'] = $dbw->timestamp( time() ); |
27 | $dbw->newInsertQueryBuilder() |
28 | ->insertInto( 'securepoll_log' ) |
29 | ->row( $fields ) |
30 | ->caller( __METHOD__ ) |
31 | ->execute(); |
32 | return true; |
33 | } |
34 | } |