I would love to make this getter return null instead of false,
similar to getExtensionData() in the same class. A property that's
not set should be null. Not a boolean. This makes it impossible to
have boolean properties. But I can't change this because it's used
in extensions with "!== false" and such.
Change-Id: I2bc0bed1c58435d791f7a055bac2763a3411bb6f
Remaining are the classes containing underscores and possibly a few other
issues that will be addressed soonish.
Change-Id: Icf56374c71afc134420ebbcfecf12dcb29dc9564
This adds the pp_sortkey column to the page_props table.
pp_sortkeys allows for top-k queries for pages, e.g.
the 100 pages with the most language links, etc. It is also
possible to query for exact values.
For now, pp_sortkey will contain pp_value's numeric value if
the value was set to a float, int or boolean.
Associated tasks:
* create a maintenance script for populating pp_sortkey. Tricky,
because when reading from the database, all values are strings.
* create an API module for querying pages by property value.
bug: 58032
Change-Id: I217c42656fb877ff35a36eb446a22bdaf119faac
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: I49f8f48b521878de7abd9cc40efdeff6cf9a37e0
The OutputPage has variables for modules, moduleScripts, moduleStyles,
moduleMessages and the config vars, but the ParserOutput is missing the
last one.
With ParserOutput::addJsConfigVars it is possible to add scripts and it
config vars at one place and have not use the MakeGlobalVariablesScript
hook or other ways to get the needed javascript variable in the output.
Change-Id: I6ad61cca76805f6b9d76e053c98c7509c323d5da
This documents how implementations of the Content interface
can control the parser cache key by calling ParserOutput::recordOption()
Change-Id: I9e8ad1e33e06aceea6e63c7d5575679f84ce4004
The Line continuation Coding conventions prefers the closing parenthesis
on the same line than the beginning curly braces. This is done for ifs
and functions.
Also move some boolean operator from the end of a line to the beginning
and changed some indentation to make the condition hopefully better
readable.
Change-Id: Id0437b06bde86eb5a75bc59eefa19e7edb624426
- Removed double spaces
- Added space after if/switch/foreach
- Removed space on elseif
- Added space around parentheses
- Added newline at end of file
- Removed space before semicolon at end of line
Change-Id: Id40b87e04786c6111e6686d7f7eea1e588bdf37d
Currently, if an extension doesn't want a TOC, it has to remove it manually.
This change wraps the TOC in markers that make it easy to remove it in ParserOutput
on demand without fragmenting the parser cache with stuff like "use/not use TOC".
Change-Id: I2889bcb9eb999c9049601e92440132118e1a8a41
Also removed some unnecessary ones. I think I've caught them all.
The spaceless version already appears in core ~300 times (after
accounting for false positives when grepping). Some consistency would
be nice.
Change-Id: I607655b5f4366e66dc78730d5fd2f57ed8776cae
While we've long had the "NewPP limit report" hidden in an HTML comment,
it is hard for users to find this as they're not likely to look for
profiling information hidden in an HTML comment. Even for those aware of
it, it's not particularly convenient to find.
This changeset adds a table showing this information at the bottom of
the page preview. It also adds the ability for this information to be
added to the ParserOutput object in a structured manner, and various
messages so the report can be localized for the end user.
Note that, for backwards compatability, the default English messages are
used for the "NewPP limit report" comment rather than the localized
messages.
Change-Id: Ie065c7b5a17bbf1aa484d0ae1f3ee0f5d41f8495
This requires minor changes in various parts of MediaWiki, and
being extra careful about cached rendered pages' HTML.
Fun fact: editsection links are not made in Parser. They're made in
Linker, in Skin *and* in ParserOutput.
Client-side code and screen-scrapers will have to be adjusted to
handle both cases (old HTML will still be visible on cached page
renders until they are purged); extensions using the DoEditSectionLink
or EditSectionLink hooks might need adjustments as well.
* Linker: Change the HTML of pages to move the link itself from the
beginning of the heading (before <span class="mw-headline">) to the end
of the heading (after the span).
* Skin: Change the class from .editsection to .mw-editsection; we use this
opportunity to clean up old cruft, and this makes it much easier to
handle cached renders (by just detecting the old class).
* ParserOutput: Implement a horrible hack to support cached parser
outputs with the old order of items.
* Ensure everything that should support both classes supports both
classes (this includes print stylesheets and some scripts).
* Implement styles for the new look for all the skins (did this in
shared.css; the styles are non-intrusive and can be overridden
easily, and all of the skins were using the same look before).
Change-Id: I6a6c12a90de3604012420b20c1f520e0ece170ab
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
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
Extensions sometimes need to stash information in the ParserOutput
for later use. This change provides a clean way to do that.
Change-Id: I8bc571d13c9a70bb71430862c2ab679ff1947126
Setting $wgRegisterInternalExternals = false for proto server should not
store the http/https links in externallinks table
Also fix detection of own links for links with query or anchor or
nothing
new also detected:
//localhost
//localhost?query
//localhost#anchor
already detected:
//localhost/path
Change-Id: Idd03d309cc3b71728a8cbea460efa12b10348d64
When inserting XML elements inline <such as this one>, doxygen chokes
about it not being known. Simply enclosing the tag in double quotes
prevents doxygen from emitting a warning.
Also enclosed a few invalid functions calls such as \. and double quoted
the HTML entities such as &foobar;
Change-Id: I4019637145e683c2bec3d17b2fd98b0c50a932f1
This supercedes I6d03bf2a, using better names for the new classes and
incorporating the changes requested by Aaron.
This change introduces the base class SecondaryDataUpdate to be used for any
updates that need to be applied when a page is changed or deleted. Until now,
this was done by the LinksUpdate class for updates and WikiPage::doDeletionUpdates
upon deletion. This patch uses a list of SecondaryDataUpdates in both cases.
This allows extensions (e.g. via the ContentHandler facility, once that is in) to
easily specify what needs to be done when a page is updated or deleted in order to
keep any secondary data stores (such as link tables) in sync.
Note that limited transactional logic is also introduced, so SecondaryDataUpdate
can be implemented to only commit their changes if all updates were performed
sucessfully.
Patch Set 2: fixing some coding style issues mentioned by Nikerabbit.
Patch Set 4: some stuff I kept from the old LinksUpdate class needs cleanup,
but might break extensions when changed. Marking as todo for now.
Patch Set 5: fixed misnamed member in LinksDeletionUpdate (thanks Aaron).
Change-Id: Ibe3e88fadd8c1d4063cf13bb6972f2a23569a73f