Commit graph

96 commits

Author SHA1 Message Date
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
jenkins-bot
9df4c26c4b Merge "Fix doc of LogFormatter::newFromRow" 2016-01-30 12:24:49 +00:00
Max Semenik
796711e0c4 Kill vestiges of SVN times
Change-Id: Ib80c71ea93479eb326ac5afea295d4608f92babe
2016-01-30 01:32:36 -08:00
addshore
1159454506 Fix doc of LogFormatter::newFromRow
DatabaseLogEntry::newFromRow can take both
objects and arrays (arrays are cast to objects).

An array is passed into this method in the
CheckUser extension.

Fixing this phpdoc will mean static analysis
tools will no longer detect that as an error

Change-Id: I84f35c21f8b4e3be0f5b5bd2051f566bda6544fc
2016-01-29 15:41:32 +01:00
umherirrender
5cf7db33fa Skip user namespace prefix for rights log entry
The target of the right log entry is shown with namespace prefix, but it
is always a user, so skip the namespace prefix.

Change-Id: Ibe6005cc70ff3933836166d97c544267fb7d9951
2015-10-10 07:38:10 +02:00
umherirrender
d6961552b3 Migrate protect log to new log system
This localize the protect type, level and expiry on Special:Log/protect.
To allow i18n there are some details stored in the log params of new log
items, these details also shown on API output.
The details cannot get from the old existing data, because there are
containing L10n strings therefore i18n works only for new items.
In the api and for IRC the old description text is still stored in the
log params for backward compatibility.

This allows use of gender on Special:Log. Old messages are kept for use
in IRC. Tests already exists to ensure an unchanged IRC message.

Bug: T47988
Change-Id: I3bb85c61b857972e66c99c499d7d785c88cafb25
2015-09-25 17:07:50 +02:00
umherirrender
3964b4cc05 Migrate move protect log to new log system
Migrate the move protect log as first sub type of the protection log,
because it does not have complex log parameter, which needs some way of
handling/migration.
It also keeps the gerrit change smaller and hopefully makes review
easier.
The other sub types of the protection log will be migrated in a later
patch set.

This allows use of gender on Special:Log. Old message is kept for use
in IRC. A test was added to ensure an unchanged IRC message.

Bug: T47988
Change-Id: I57b3bd8a7dc823acdbb56520d2364f5542283373
2015-08-18 22:20:35 +00:00
umherirrender
f087bcb620 Use assertSame in LogFormatterTestCase
Using assertSame also checks for internal types to be correct.

Needs the following fixes:
- MergeLogFormatterTest: Use correct array key order
- NewUsersLogFormatterTest: Input user id as integer
- PatrolLogFormatter: Ensure in LogFormatter that
  integer is not casted to float

Change-Id: I2cab5335d6654f6cda15fc4e9fbae2c1ca1b27ff
2015-06-06 20:55:03 +02:00
Kevin Israel
272843a55d Move some global statements to top of function
These were flagged by mediawiki/tools/code-utils/check-vars.php
because they were located inside a switch statement, or inside an
if statement and used outside the statement. All other warnings
from that script are bogus, mostly because the script has no
support for PHP 5.3 namespaces.

Change-Id: If93bae4434b5c28845125095f6a22d6788a76efc
2015-05-06 20:19:32 +00:00
Brad Jorsch
61233fc847 API: Move parameter formatting into LogFormatter
This allows for extensions to format their log entry parameters, and
keeps the code for formatting API log entry parameters in the same place
as for other formatting.

This also takes the opportunity to rearrange the output format slightly
to avoid conflicts like what's happening in T73020.

Bug: T35235
Bug: T73020
Bug: T91466
Change-Id: I6846ce09322eb404c506b5a51780a44ce9279fe2
2015-04-17 04:59:41 +00:00
This, that and the other
ae3ab9eef0 Allow users to add, remove and apply change tags using the API
You can add tags at the same time as performing action=edit, as long as you
have the "applychangetags" right. Also, you can add or remove tags after
the fact from revisions and log entries using the API action=tags.

No UI is provided for either of these changes. The target audience is user
scripts, gadgets and similar tools.

Includes a new log parameter format type: "list", for a comma-separated
list of values.

Logging of change tag events is limited to those that do not accompany an
edit (i.e. those done after the fact), and is hidden from Special:Log by
default, similar to the patrol log.

Bug: T20670
Change-Id: I37275e0f73fa3127f55da0c320b892551b61ee80
2015-04-15 18:30:45 +00:00
Timo Tijhof
15e8dc1ecf LogFormatter: Indent code to fix Doxygen parse error
This file was not being indexed due to a parse error.

> /includes/logging/LogFormatter.php:844:
>   warning: Reached end of file while still inside a (nested) comment.
>   Nesting level 2 (probable line reference: 48, 26)

Change-Id: Ie34ae644d06e705991b934d4389e8c41bb7f77a7
2015-04-02 19:51:56 +00:00
umherirrender
4f60a37d4e Migrate import log to new log system
There is no need for an extra formatter class, because at the moment
there is nothing extra to format.

This allows use of gender on Special:Log. Old messages are kept for use
in IRC. A test was added to ensure an unchanged IRC message.

The new log message for import-interwiki is used from
I3ca8b21bce49b41cac7109efb8056ca4469b88d7 to avoid "transwiki jargon".

Bug: T57404
Change-Id: I590075b203548c071a98c1eaa4b1bc9250f60e22
2015-03-18 13:21:52 +00:00
umherirrender
68c945d796 Fix IRC lines for blocks published with the old logging system
The CheckUser and GlobalBlocking extension are inserting the block logs
over the old logging system, where the keys are numeric.
This case is not known when building the irc line, because that was
already migrated to just get the new style.
Added compatibility code for legacy rows.

Needs the legacy flag also in ManualLogEntry to make this happen,
because it is using the LogFormatter of the new logging system to format
the actionText.

Have not found the old way for block/reblock, so just for block/block.

Bug: T92713
Follow-Up: Ibc7fcaa5a952ff90d42a6477da4baa429f3de64b
Change-Id: I08aea8399ce766e98c1a76e237169f220c6cc751
2015-03-14 13:43:13 +01:00
umherirrender
ce4af8b873 Fix parameter order for block logs
The new block log params does not known the message number 4 (which is
index 3), therefore LogFormatter::getMessageParameters adds empty index
to keep the sequence in strong order.
But the loop was starting at index 4, not 3, which skips the needed
empty index 3 for the order.

Due to the missing $4 the legacy log params returning index 3 and 4,
therefore move them one up to match the new numbers.

Also fixed undefined index warnings for api's list=logevents

Follow-Up: Ibc7fcaa5a952ff90d42a6477da4baa429f3de64b
Change-Id: Ie23be129ee2bd1d2bf753c3b5cba293d64b8e0e8
2015-02-24 19:37:03 +01:00
jenkins-bot
8888bac668 Merge "Migrate block log to new log system" 2015-02-22 00:46:35 +00:00
Matthew Flaschen
bb704ad136 Define the context field in LogFormatter
Public for backwards-compatibility.

Change-Id: I6d66d14b58def1fe6674b47d1e4d3ff53034bf2c
2015-02-12 22:55:12 -05:00
umherirrender
c891ff00ed Migrate block log to new log system
This allows use of gender on Special:Log.
Old messages are kept for use in IRC.
A test was added to ensure an unchanged IRC message.

Bug: T57402
Change-Id: Ibc7fcaa5a952ff90d42a6477da4baa429f3de64b
2015-02-07 21:02:10 +01:00
Niklas Laxström
5e969b82d1 Escape word-separator in LogFormatter
Change-Id: I9428f5ff5b95d09932b3588f0118d6992a384390
2014-12-29 20:08:20 +00:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
umherirrender
52f5634ba0 Migrate merge log to new log system
This allows use of gender on Special:Log
Old message is kept for use in irc,
a test is added to ensure a unchanged irc message.

Change-Id: I0557a0d2751540cf0d7967333ffd767b934011c6
2014-10-21 16:49:06 +00:00
Aaron Schulz
bf8a180ab3 Show the revision list immediately on "umerge" log action links
Change-Id: I47804a54321fa317b36428d67c24b71d8c27a667
2014-08-27 16:55:43 -07:00
umherirrender
b883e8c7c0 Cleanup some docs (includes/[e-l])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: I41a84e8e1dec39170aa655250325ffc485eaeaef
2014-07-24 19:43:03 +02:00
umherirrender
b45420410f Fixed some @params documentation (includes/*)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: Iced714bca004756b461b66067a49a925a7e3b877
2014-04-19 22:22:20 +02:00
umherirrender
edc924869f Changed some comments from /// to /** @var */
Change-Id: I55b30099e4464c272c35bcabbddbb0b1364a5d65
2014-04-07 05:01:19 +00:00
Kartik Mistry
2daafebc77 Do not use jargon in comment.
* luser -> user

Change-Id: Iab8033dea8f0cbf628563ca5434f3d939fe6b3df
2014-02-06 17:13:28 +05:30
umherirrender
073abe3e12 No variable assignment on return statement
Split the variable assignment and the return statement in two lines for
better readability.

When there was two return statements in one method the logic was swapped
to have only one return statement.

Change-Id: Id7a01b4a2df96036435f9e1a9be5678dd124b0af
2014-01-02 09:43:35 +00:00
Siebrand Mazeland
e64f4d9f12 Update documentation for log related classes
Change-Id: I4e00cda46cc7bbcbd17ac2d3d025a76281ee84b6
2013-12-06 00:07:12 +01:00
Siebrand Mazeland
86fe1da236 Break long lines in logging related classes
Also:
* Take function call out of for loop test part.
* Suppress CodeSniffer warnings for unavoidable long lines.

Change-Id: I14044f14b30d494d910541a1dac50921254a7398
2013-12-03 15:58:51 +01:00
Siebrand Mazeland
8a536b8591 Update formatting for log related classes
Change-Id: I6535467ed9b22d61b7c5caf3f18067a988871751
2013-12-03 15:36:21 +01:00
umherirrender
9f14ecf829 Added space after switch/Removed spaces after unset
While at it, added/removed some other spaces in the same files

Change-Id: I84d8001aa123a008807ad5eb76f396aed7c899a4
2013-04-26 16:42:31 +02:00
umherirrender
6c38a5eb72 Fixed spacing in logging/parser/profiler/rl/revdel/search folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I11bbcfa351e945b7bde10c2105d61a3cf5622205
2013-04-20 17:38:24 +02:00
Alexandre Emsenhuber
744c0c7541 Move subclasses of LogFormatter to their own file
Except LegacyLogFormatter.

includes/logging/LogFormatter.php is getting bigger and bigger with
the addition of new formatters when logs are changed to use them
instead of the old method, so better doing this now before we get
new formatters for remaining log types.

Change-Id: I6aab19c8d68bf47beddad42632b0360a7b12f251
2013-03-15 15:25:33 +01:00
jenkins-bot
6114f05fc1 Merge "Correct case of Title::getPrefixedDBkey() calls" 2013-03-12 15:13:21 +00:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Alexandre Emsenhuber
cd4dd7ca85 Correct case of Title::getPrefixedDBkey() calls
Change-Id: Ic9ef0cc6dbb0a8eb0ee93432299ef59759223e2c
2013-03-09 21:14:22 +01:00
Reedy
c3e4057e06 Kill off numerous unused variables
Change-Id: I7039f1328f37ee669b694f73ee282602186bffd1
2013-03-08 02:36:24 +00:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
umherirrender
3f58c15f5a Add username for GENDER in LogFormatter only when visible
For sanity.

bug:42621
Change-Id: If133597f06edcfdda4ad7a47506635743c80cd53
2013-03-04 12:04:47 -08:00
umherirrender
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
umherirrender
be90ce07b3 fix some spacing
Change-Id: I93f0a87ba7129bc336083e7289247d3150feb606
2013-02-04 19:54:07 +00:00
Alexandre Emsenhuber
b65893755f Added new "byemail" action to the new users log
This allows to display the "password sent by e-mail." string in the user's language
since it's now in the action text rather than always in content language due to the
fact it was hardcoded in the log's comment.

Insertion of log entries for the new users log is now acomplished using the
ManualLogEntry class rather than the old LogPage one.

Removed 'newuserlog-byemail' message since it's no longer used (also checked
extensions in Wikimedia's Git repo).

IRC notifications will use the same message for 'create2' and 'byemail' for backward
compatibility. The only difference is that 'byemail' entries will no longer have
"password sent by email." in the comment.

Change-Id: Icdf1d714259d054cf8c256faf894c533be0dc73c
2013-01-25 16:15:33 +01:00
Alex Monk
8d70936ced Show changed bits on file version (oldimage) revdel logs.
Don't know if there is a bug for this or not, but I noticed that we don't get "content hidden/unhidden" type notes for revdel logs when they're for file revisions (instead of page revisions)

Change-Id: I0de389e601aaad7fd8abb989b4a0004082206894
2013-01-03 04:06:02 +00:00
jenkins-bot
c1cfc80ed0 Merge "(bug 42211) Fix the display of some user rights log entries" 2012-12-12 18:35:05 +00:00
jan
8b5bfd8b88 (bug 24620) Add types and test for LogFormatter
This change adds types to LogFormatter like "msg" so log values
(parameters for the log message) can be formated as e.g. a message in
user or content language.

This change adds tests for LogFormatter, too. Tested are the normal log
params, the log params with type and the output of the comment.

This change repairs the changes I6a56c204 and I7218a173

Change-Id: Ief3665056b3bb613ff709821306017ee7967c444
2012-12-12 01:00:03 +00:00
Siebrand
b9e092fa4b Revert "(bug 24620) Add types to LogFormatter"
This breaks extensions because of changing protected methods to public (LogFormatter::getMessageParameters() in particular). We need a solid solution. The next 1.21-wmf is being branched tomorrow. Revert is the sanest solution at the moment.

This reverts commit 1c296faf58
2012-12-10 01:24:21 +00:00
jan
1c296faf58 (bug 24620) Add types to LogFormatter
This change adds types to LogFormatter like "msg" so log values
(paramaters for the log message) can be formated as e.g. a message in
user or content language.

If you want to add another type feel free to suggest it in your review.

Change-Id: I6a56c2041bcbce292cff485e706db02305aab01c
2012-12-09 23:50:41 +00:00
Alex Monk
baf34a747b (bug 42211) Fix the display of some user rights log entries
Change-Id: Iba8891bbf0891fa82c0e76b5a604bf05c14aded5
2012-11-17 22:13:13 +01:00
Alexandre Emsenhuber
4c69cd3ad6 Use LogFormatter to format rights log.
* Has to keep actual messages for IRC notification
* Catch really old log entries with no parameters and use an
  appropriate message in that case to not always display erroneous
  "X changed group membership for Y from (none) to (none)".

Change-Id: Ie188bc6fcdf672fe31f0f389a158aab6256031fa
2012-10-22 19:28:32 +02:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00