Commit graph

43 commits

Author SHA1 Message Date
Brian Wolff
729be8690b Fix CreditsAction when user has no real name set but real names enabled
Change-Id: Ief347739a1231fa8bd814694bdb5b4f44ba41a77
2017-09-28 02:36:31 +00:00
Kunal Mehta
0cb2a09b6d Always put type information before variable name for @var tags
Like other tags, @var should have the type information before the
variable name.

<https://docs.phpdoc.org/references/phpdoc/tags/var.html>

Change-Id: I9eca6957b1990fa8cc687103dc02ee38af5f9086
2017-09-04 11:06:51 -07:00
Umherirrender
b5cddfb27b Remove empty lines at begin of function, if, foreach, switch
Organize phpcs.xml a bit

Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
2017-07-01 11:34:16 +00:00
Haikal Izzuddin
2c657ec256 Replace Linker::link() usage with LinkRenderer
Bug: T149346
Change-Id: Ie384566617f18ad6c3bf836b39702365d59f714d
2016-12-01 12:04:38 -08:00
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
Ricordisamoa
2ae155da52 Fix phpcs errors in includes/
Mostly Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines

Change-Id: I678b2f0902f11cd1dfa1611b9da24e7237df9122
2015-01-08 20:15:07 +01:00
Chad Horohoe
aa21e125a3 Remove obvious function-level profiling
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.

Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.

Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
2015-01-07 11:14:24 -08:00
Kunal Mehta
f6b5b8c899 includes/actions/: Use Config instead of globals
Changed InfoAction::pageCounts to be non-static, so
it's able to access $this to get the Config object.

Also replaced instances of $wgScript with wfScript().

Change-Id: I4a6a3224e762f13640af04a73e2934b887dffedd
2014-08-13 20:34:32 +00:00
umherirrender
02dc9da399 Cleanup some docs (includes/[a-d])
- 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: I7b65fe04db431342cc58b469dc48f41a50c4e891
2014-07-24 19:42:45 +02:00
umherirrender
829886b10a Fixed some @params documentation
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.

Change-Id: I64e8cfe478cb0ba438f40b0631d6e9049cdab567
2014-04-14 12:59:19 +00:00
Reedy
d0554cd521 Revert "Update type hint for CreditsAction::getAuthor()"
This reverts commit 8a9a1eff3e.

Change-Id: I689645c812b1a28821a3d6854bc7737fc677e29e
2013-12-30 18:11:20 +00:00
Siebrand Mazeland
8a9a1eff3e Update type hint for CreditsAction::getAuthor()
This function calls $page->getUserText() and $page->getTimestamp(). These
functions are not specified in the interface Page (which actually specifies
nothing at all). Page is only implemented by WikiPage and Article. Article
does not implement getUserText() and getTimestamp(). WikiPage does.
CreditsAction::getAuthor() cannot ever be given an Article, because that
would cause a fatal error "call to undefined method".

Change-Id: I0ba29622b7307845345ce645cb63b53614aaf2ab
2013-12-30 18:03:09 +00:00
Siebrand Mazeland
6b237ebf55 Update docs for files in includes/actions/
Change-Id: I99655ad3df4bc252e3c176e4f465f5ecd615c55f
2013-11-14 20:09:19 +01:00
Siebrand Mazeland
6ea188fee5 Update formatting
Change-Id: I3cbe1f5e48730fbbe57e4b20a0c202edddc93c95
2013-11-14 12:20:43 +01:00
umherirrender
1bfc8feb25 Fixed spacing in actions/cache/filebackend/filerepo/job folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Idb93d34e314e5f314223b79208968d6bcd30c40e
2013-04-20 19:18:13 +02:00
Siebrand Mazeland
bb06eee756 Fix PHPDoc
Was incorrectly documenting Article instead of Page. Also changed $article
to $page to avoid confusion.

Change-Id: I366769a201b5fda1c8d59119bdac908fd7727cbf
2013-04-01 18:39:01 +02:00
jenkins-bot
bbd9c84e10 Merge "Documentation improvements in includes/actions" 2013-03-12 15:11:12 +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
a09a89b48e Documentation improvements in includes/actions
- Separate file and class documentation
- Add some missing class documentation
- Fix erroneous documentation

Change-Id: I35c846ad63e837165b79456dc89d330498aebf64
2013-03-05 16:39:35 +01:00
umherirrender
85d8ee1f87 Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I00f369641320acd7f087427ef031f3ee7efa0997
2012-10-10 20:14:40 +02:00
Alex Monk
8945408808 (bug 40820) Revert my changes to includes/actions/CreditsAction.php
Also don't show contributors on action=info

Change-Id: I48b70b3d6b94e295aca23d506c7cce9185df4bcc
2012-10-07 15:05:26 +01:00
Alex Monk
c32c322cdd A few action=info bugfixes and enhancements.
(bug 39533) Merge action=credits into action=info.
(bug 39951) Remove redundant 'Page protection' text.
(bug 39953) Don't show irrelevant protection statuses.
(bug 39954) Use proper section headers.
(bug 39955) Link page creator and latest editor values.

Change-Id: I68308aac96b89c2aec296e2a4fa385fd1d42ab5a
2012-10-04 15:29:51 +00:00
Alexandre Emsenhuber
42e7cffd3b Use local context to get message
Change-Id: Ieeb4b20591baa3b6ceebdef55953648142622b44
2012-03-25 22:10:09 +02:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Jeroen De Dauw
8bdd53ee05 fix xss 2012-01-30 12:24:24 +00:00
Chad Horohoe
394a5ba7a7 Reduce some duplication in Action::getRestriction(), all but 2 (plus one extension) return null anyway 2011-12-06 17:40:12 +00:00
John Du Hart
216d661d3b Bug 29524 - Rename RequestContext::getLang to getLanguage
I'll be amazed if this doens't break any tests.
2011-11-21 16:13:21 +00:00
Alexandre Emsenhuber
2b3f7ae7b4 * Use local context instead of global variables, made static function in CreditsAction non-static so that they can use the context
* Added missing Action::msg() method
2011-10-07 17:49:45 +00:00
Alexandre Emsenhuber
582ad7e513 Removed useless check since the variable always exists and null would be catched by the second part 2011-09-16 19:39:53 +00:00
Robin Pepermans
d4facc4734 Do r91966 in a different way, per Brion: use unicode-bidi:embed; instead of white-space:nowrap; 2011-07-12 21:28:44 +00:00
Robin Pepermans
ac129add2b (bug 12205) Bidirectional names in action=credits are split and displayed incorrectly when wrapped to the next line. 2011-07-12 14:58:58 +00:00
Aaron Schulz
930ccf282c * Split off WikiPage class from Article, WikiFilePage class from ImagePage, and WikiCategoryPage from CategoryPage.
* WikiPage functions/fields are "magically" part of Article when accessed for b/c. Magic is kind of ugly but there are too many callers to make breaking changes atm. Some functions are just wrappers for WikiPage ones (were magic won't work).
* Added newFromID() to each WikiPage subclass (works around pre-existing inheritance problem).
* Added Page class for convenient type hinting and changed hints from Article -> Page. This lets things use WikiPage objects without getting type errors.
* Updated FlaggedPage to extend WikiPage. Worked around getOldIdFromRequest().
* Added setTimestamp() to WikiPage and moved some timestamp setting code from ParserCache to Article.
* Removed ampersands from $dbw arguments.
* @TODO: dependency inject user objects for WikiPage

The idea is to migrate things to use WikiPage, as the run-of-the-mill "new Article()" call doesn't care about $oldid and $wgRequest. After that, Article, ImagePage, and CategoryPage can be rewritten as an Action class or something sane (a Viewer class of sorts).
2011-06-29 22:09:51 +00:00
Happy-melon
d8b6ca8c0f Follow-up r90877: spot the copy-and-pasted code... :D 2011-06-27 16:22:01 +00:00
Happy-melon
93cece6d9e Follow-up r86044 CR (correct subtitle message for action=credits), and some documentation. 2011-06-27 14:05:23 +00:00
Sam Reed
2b676156ba And even more documentation 2011-05-28 18:58:51 +00:00
Sam Reed
50d5b074d0 And some more parameter documentation!! 2011-05-28 16:31:00 +00:00
Alexandre Emsenhuber
b345db080f I have no idea where that count() pass in r87165 2011-04-30 15:14:12 +00:00
Alexandre Emsenhuber
1679309cb5 Properly escape the ouput in action=credits (and in page footer), using wfMessage() to be able to replace some parameters before and some after 2011-04-30 15:12:33 +00:00
Sam Reed
a6f56411a2 Remove some unused variables/globals
Fix another unreachable statement
2011-04-16 11:28:35 +00:00
Happy-melon
08d460d384 Follow-up r 86041 per CR and IRC:
* Article constructor needs to be called with zero as second parameter
* Run stylize.php over new files
* Add Action::getLang() for consistency with other context accessors
* Fix declaration of FormAction::alterForm(), doesn't need to be passed by reference
* Fix inline use of Credits::getCredits() in SkinTemplate and SkinLegacy
2011-04-14 12:17:24 +00:00
Happy-melon
8779f4b55f r86001, now with less scariness :P I took out the delete action and did purge instead, which is a much more self-contained action-with-a-form. Also implement a few changes suggested by Brion on IRC last night. 2011-04-14 10:38:29 +00:00
Happy-melon
bc4a096805 Revert r86001: Brion says it's too scary :D will recommit in pieces 2011-04-13 23:36:27 +00:00
Happy-melon
6dc8136d12 New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
2011-04-13 23:04:07 +00:00
Renamed from includes/Credits.php (Browse further)