14 return DeleteAutoPatrolLogs::class;
19 $this->tablesUsed = [
'logging' ];
35 'log_type' =>
'patrol',
36 'log_action' =>
'patrol',
39 'log_timestamp' => $dbw->timestamp(
'20041223210426' ),
41 'log_title' =>
'DeleteAutoPatrolLogs',
46 'log_type' =>
'patrol',
47 'log_action' =>
'autopatrol',
50 'log_timestamp' => $dbw->timestamp(
'20051223210426' ),
52 'log_title' =>
'DeleteAutoPatrolLogs',
57 'log_type' =>
'block',
58 'log_action' =>
'block',
61 'log_timestamp' => $dbw->timestamp(
'20061223210426' ),
63 'log_title' =>
'DeleteAutoPatrolLogs',
68 'log_type' =>
'patrol',
69 'log_action' =>
'patrol',
71 'log_params' =>
'nanana',
72 'log_timestamp' => $dbw->timestamp(
'20061223210426' ),
74 'log_title' =>
'DeleteAutoPatrolLogs',
79 'log_type' =>
'patrol',
80 'log_action' =>
'autopatrol',
83 'log_timestamp' => $dbw->timestamp(
'20071223210426' ),
85 'log_title' =>
'DeleteAutoPatrolLogs',
90 'log_type' =>
'patrol',
91 'log_action' =>
'patrol',
93 'log_params' =>
serialize( [
'6::auto' =>
true ] ),
94 'log_timestamp' => $dbw->timestamp(
'20081223210426' ),
96 'log_title' =>
'DeleteAutoPatrolLogs',
101 'log_type' =>
'patrol',
102 'log_action' =>
'patrol',
104 'log_params' =>
serialize( [
'6::auto' =>
false ] ),
105 'log_timestamp' => $dbw->timestamp(
'20091223210426' ),
107 'log_title' =>
'DeleteAutoPatrolLogs',
112 'log_type' =>
'patrol',
113 'log_action' =>
'patrol',
115 'log_params' =>
"9227851\n0\n1",
116 'log_timestamp' => $dbw->timestamp(
'20081223210426' ),
118 'log_title' =>
'DeleteAutoPatrolLogs',
123 'log_type' =>
'patrol',
124 'log_action' =>
'patrol',
126 'log_params' =>
"9227851\n0\n0",
127 'log_timestamp' => $dbw->timestamp(
'20091223210426' ),
129 'log_title' =>
'DeleteAutoPatrolLogs',
132 $dbw->insert(
'logging', $logs );
138 'log_type' =>
'patrol',
139 'log_action' =>
'patrol',
140 'log_user' =>
'7251',
143 'log_type' =>
'patrol',
144 'log_action' =>
'autopatrol',
145 'log_user' =>
'7252',
148 'log_type' =>
'block',
149 'log_action' =>
'block',
150 'log_user' =>
'7253',
153 'log_type' =>
'patrol',
154 'log_action' =>
'patrol',
155 'log_user' =>
'7253',
158 'log_type' =>
'patrol',
159 'log_action' =>
'autopatrol',
160 'log_user' =>
'7254',
163 'log_type' =>
'patrol',
164 'log_action' =>
'patrol',
165 'log_user' =>
'7255',
168 'log_type' =>
'patrol',
169 'log_action' =>
'patrol',
170 'log_user' =>
'7256',
173 'log_type' =>
'patrol',
174 'log_action' =>
'patrol',
175 'log_user' =>
'7257',
178 'log_type' =>
'patrol',
179 'log_action' =>
'patrol',
180 'log_user' =>
'7258',
187 [
'--sleep',
'0',
'--dry-run',
'-q' ]
199 [
'--sleep',
'0',
'-q' ]
201 'run with before' => [
212 [
'--sleep',
'0',
'--before',
'20060123210426',
'-q' ]
214 'run with check-old' => [
224 [
'--sleep',
'0',
'--check-old',
'-q' ]
228 foreach ( $cases as $key => $case ) {
229 yield $key .
'-batch-size-1' => [
231 array_merge( $case[1], [
'--batch-size',
'1' ] )
233 yield $key .
'-batch-size-5' => [
235 array_merge( $case[1], [
'--batch-size',
'5' ] )
237 yield $key .
'-batch-size-1000' => [
239 array_merge( $case[1], [
'--batch-size',
'1000' ] )
251 $this->maintenance->loadWithArgv(
$args );
253 $this->maintenance->execute();
257 [
'log_type',
'log_action',
'log_user' ],
260 [
'ORDER BY' =>
'log_id' ]
263 $this->assertEquals( $expected, iterator_to_array( $remainingLogs,
false ) );
270 [
'log_params' =>
'nanana' ]
273 $this->maintenance->loadWithArgv( [
'--sleep',
'0',
'--from-id', strval( $fromId ),
'-q' ] );
275 $this->maintenance->execute();
279 [
'log_type',
'log_action',
'log_user' ],
282 [
'ORDER BY' =>
'log_id' ]
286 'log_type' =>
'patrol',
287 'log_action' =>
'autopatrol',
288 'log_user' =>
'7254',
291 'log_type' =>
'patrol',
292 'log_action' =>
'autopatrol',
293 'log_user' =>
'7252',
296 $remainingLogs = array_map(
300 iterator_to_array( $remainingLogs,
false )
303 $this->assertNotContains( $deleted, $remainingLogs );
304 $this->assertContains( $notDeleted, $remainingLogs );
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...
Database DeleteAutoPatrolLogs.
testRun( $expected, $args)
runProvider
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest object
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))