Commit graph

292 commits

Author SHA1 Message Date
umherirrender
986eead588 Fixed some @params documentation (includes/[Block.php|Revision.php])
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: Ie592d31e85651663e3b3e1aa4ee7c270d06d0c81
2014-04-23 11:25:56 +02:00
Bartosz Dziewoński
59002d8935 Consistently use '@deprecated since <version>'
Variants included 'in <version>', 'as of <version>' and just the
version number.

Some @deprecated annotations do not have the version number at all,
I want to hunt them down separately.

Change-Id: I8208c6097098f4735d4f51bc42254675f1f27f6d
2014-04-15 22:18:19 +02:00
Siebrand Mazeland
130517e6d4 Update docs for Revision::getRevisionText()
Change-Id: I9e4218bec9fd69a50e06ba9fcd8bdf8461163a47
2014-01-01 15:32:48 +00:00
Siebrand Mazeland
4e8687a884 Remove deprecated methods from Revision, SkinTemplate, and WikiPage
No uses found in core of Gerrit extensions.

- Revision::revText() (deprecated in 1.17)
- SkinTemplate::jstext() (deprecated in 1.21)
- WikiPage::quickEdit() (deprecated in 1.18)
- WikiPage::useParserCache() (deprecated in 1.18)
- WikiPage::viewUpdates() (deprecated in 1.18)

Change-Id: I9eee23ea3ce381b6b8373da899287bcaea4cead4
2013-12-27 19:44:14 +01:00
umherirrender
2dade3b9da Break long lines and remove some spaces in Revision.php
Change-Id: If62a01096319dddaa898daaabdd6e881316a0ad7
2013-12-07 21:58:53 +01:00
umherirrender
299eb8d27d Fixed spacing of exception message in Revision::checkContentModel
Change-Id: Ibbd693719d03569a4d9c5cf0b61079edd4bc40ff
2013-12-02 06:41:30 +00:00
umherirrender
0bc583af2c Move closing parenthesis from multi line if and function to own line
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
2013-12-01 21:39:00 +01:00
umherirrender
5ca5672aac Fixed spacing
- Place commas correct
- Moved comments
- Add space after if/foreach/catch
- Reformat some conditions
- Removed trailing spaces/tabs

Change-Id: I40ccda72c418c4a33fcd675773cb08d971510cdb
2013-12-01 20:58:51 +01:00
Reedy
b0aebdaa0a Fix populateRevisionLength.php so it's not trying to select revision
fields from the archive table (they won't exist!)

Follows up https://gerrit.wikimedia.org/r/#/c/54111/

Change-Id: Ie161a08097a2cd3393d69574263cfe78e4329bb4
2013-10-28 22:08:50 +00:00
Tim Starling
e6b1baf240 Avoid master queries in Revision::newFromTitle(..., Revision::READ_NORMAL)
The fallback to master makes sense in Revision::newFromId(), since a
revision ID known to exist by some other means might be present in the
master but not in the slave. But it doesn't make sense for
Revision::newFromTitle(), where by far the most common cause of this
case being hit is the page being nonexistent.

Change-Id: I41189fcde1b8065ac134982241376d63b78732a1
2013-10-23 00:22:50 +00:00
Aaron Schulz
f1ed25f095 Fixed trx isolation bug that could cause text not to be found
* Also added some logging for when revision text is not found

bug: 53687
Change-Id: I0993e8f49d36771cc526fd4afef67455209b8e3a
2013-10-09 17:14:53 +00:00
jenkins-bot
4800843495 Merge "Make revision content decompression publicly available" 2013-08-07 21:00:02 +00:00
Matthias Mullie
7e6107b555 Make revision content decompression publicly available
compressRevisionText() is already publicly available, but the decompression was
not. For others using compressRevisionText(), the only way to decompress was to
duplicate the gzinflate code.

Change-Id: I61cd87acb52a482ba88f7c9d3826ecee66c89911
2013-08-07 20:53:34 +02:00
Petr Onderka
942dd53f97 Force lazy loading of text in Revision::getSerializedData()
Change-Id: Ic47fd482523e0a2c705c24e93525959eca52409a
2013-08-06 19:10:20 +02:00
Marius Hoch
50faf2138c Allow patrolling pages by revision id
This became necessary as it's quite hard to
get the rc id of a change from the html after
I1e24733c.

Bug: 49259
Change-Id: Ia7d3960cf11bf8ae0fc06ae1a0f7fcfb3c080f21
2013-06-10 20:54:43 -04:00
Timo Tijhof
4bd5471ca3 docs: Remove odd colons after @todo
Most were this way already:
https://doc.wikimedia.org/mediawiki-core/master/php/html/todo.html

Ran a find/replace on the odd ones. Also made them all
lower case.

Change-Id: I70c6a69344ddebc603e9a1c1d87e3cc4f4f4c560
2013-05-15 06:23:40 +00:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
umherirrender
978bb31c5e Add missing wfProfileOut before throwing an exception
Change-Id: I1d830da0597f19efd0b2ae48642389975e736e23
2013-04-08 18:37:24 +00:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls

Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"

Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
2013-03-13 03:42:41 -04: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
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
jenkins-bot
fda29425c4 Merge "Few minor parameter type hints in documentation" 2013-03-07 01:01:39 +00:00
Reedy
7a2bc6d480 Few minor parameter type hints in documentation
Change-Id: Ibcaad4427375b9aa39bb2b333b72a0beb9a3620c
2013-03-06 01:17:31 +00:00
Siebrand Mazeland
9b7889b84b Use American English spelling for behavior
Spotted in ipbreason-dropdown by Shirayuki.

Change-Id: I576ed4bc0abe5ab980aaee3fb9f9e4b43087311f
2013-03-04 10:24:57 +01:00
Chad Horohoe
6f4448dd71 Remove DB2 support
Change-Id: I9b294a213a4000f503c0010d88757db6dda927c0
2013-02-25 13:47:03 -08:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
Alexandre Emsenhuber
4b6a0ff988 Correct isset() and associated checks in Revision::__construct()
isset() checks that the member is set *and* its value is not null,
so there's no point doing a second is_null() check.
This also fixes an E_NOTICE when rev_parent_id is not set since
is_null() was called on it after isset() returned false.

Change-Id: I07bf670236413436d23ee5d87d032608b25769ce
2012-12-28 13:03:06 +01:00
daniel
45a197b1a5 (bug 42948) $wiki parameter for getRevisionText().
Revision::getRevisionText should take wiki identifier, to allow for the loading
of revision blobs from another wiki's database. This is passed through to
ExternalStoreDB, so it uses the correct database connection.

Change-Id: I14a7ebb8aa31a4e50735db9c28ff8d2759cd872c
2012-12-11 13:03:20 +01:00
daniel
d4d929b352 fix conflict marker in comment
Change-Id: I23e9593890ab5899e10d8eb61f63f38fb98072a7
2012-11-12 14:37:32 +01:00
daniel
2b440f71ea (Bug 41244) Gracefully handle failure to load text blob.
This change fixes fatal errors ocurring when Revision::loadText
returns false because of a failure to load the text blob.
Revision::getContent() should simply return null in such a case.

Change-Id: I1e13de14ff15b124b5a2e07155d368595a16fda7
2012-11-10 15:58:17 +01:00
Alexandre Emsenhuber
1f8652df65 Follow-up I551a90b0 (c2172d4): add one more check for null content
Change-Id: Ifa26ea8df0c5dd1f4c6ecabb9c8020bb84401ea3
2012-11-10 14:02:51 +01:00
daniel
c2172d45e4 Beware that getContent() may return null
Before the introduction of the content handler, missing content was
signified by getText() returning null instead of a string. null will
work much like an empty string in most contexts, so in many places,
it was not checked explcitely whether the conent was null.

Now, when getContent() returns null, this often caused a fatal error,
because the code would access whatever getContent() returned as an object,
without checking whether it was null (because no such check was performed
previously, when the content was represented as a string).

This check introduces explicite checks for getContent() returning null
in the most essential core classes.

Change-Id: I551a90b0b67b8edc7570ca5d252ecc1de903f097
2012-11-09 19:45:12 +01:00
Siebrand Mazeland
2f91a00343 Add since 1.20 for Revision::READ_LATEST
Change-Id: Ifd33f6eca5478e2dc4d8092d509d5ca4f3eda34a
2012-11-08 07:04:02 +01:00
Demon
dc0e410e29 Merge "(Bug 41574) Supply Title object to Revision if possible." 2012-11-01 16:48:48 +00:00
daniel
b5b2b2f898 (Bug 41574) Supply Title object to Revision if possible.
The Revision object needs the Title to determine the default content model.
Providing the Title explicitely wherever possible avoids an extra database
lookup. Most importanlty, this fixes fatal errors that ocurr when the
database lookup fails due to slave lag or transaction state.

Change-Id: I516e82f7a893b274c513b128b8a46db491160b55
2012-11-01 13:48:18 +01:00
daniel
ff31d6eb39 (Bug 41617) Fix undelete.
Undeletion was broken twice:

1) originally, it failed silently, restoring revision entries with
the wrong number in rev_page.

2) I789e45bd restores an overly zealous sanity check, causing
undeletion to fail with a fatal error.

This change fixes both issues.

Change-Id: I796fe54e81773f7982ae9bc15ba30f2a2ee3f174
2012-11-01 12:12:11 +01:00
RobLa
789e45bdc9 Revert "(Bug 41436) Tone down sanity check, just warn, don't die."
This reverts commit 770b6519be

This seems to have introduced bug 41606.  By reverting, we get an exception rather than complete data loss.
2012-11-01 04:58:19 +00:00
daniel
770b6519be (Bug 41436) Tone down sanity check, just warn, don't die.
This is a follow-up to I9db228c3 fixing an issue with undelete:

Page ID 47009 mismatches the ID 47010 provided by the Title object.

Backtrace:

0 /var/www/CephWiki/core/includes/Revision.php(188): Revision->__construct(Array)
1 /var/www/CephWiki/core/includes/specials/SpecialUndelete.php(548): Revision::newFromArchiveRow(Object(stdClass), Array)
2 /var/www/CephWiki/core/includes/specials/SpecialUndelete.php(381): PageArchive->undeleteRevisions(Array, false, '')
3 /var/www/CephWiki/core/includes/specials/SpecialUndelete.php(1510): PageArchive->undelete(Array, '', Array, false, Object(User))
4 /var/www/CephWiki/core/includes/specials/SpecialUndelete.php(778): SpecialUndelete->undelete()
5 /var/www/CephWiki/core/includes/SpecialPage.php(599): SpecialUndelete->execute(NULL)

Change-Id: I0517c5826bcba2a85fee596b0473a16da26c3b2f
2012-10-29 19:51:50 +01:00
daniel
8498a4f575 (Big 41436) Make sure Revision knows page Title.
With $wgContentHandlerUseDB, Revision needs access to the page's Title
object to determin the page's default content model. This apparently
failed in production for newly created pages (supposedly because of
some complication with database transactions or master/client setup).

This change makes WikiPage::doEditContent pass the Title object
directly to the Revision to avoid any database issues. This also
gets rid of a pointless database read.

Change-Id: I9db228c3fcda0f8dfe52be1659014a6e4b4775af
2012-10-29 16:31:16 +01:00
Reedy
df60d0ccf2 Fixup some method documentation return types
Remove an unused getTitle

Change-Id: Ic34ea605b39568f582d5f4f90cf36d3d654e4746
2012-10-17 23:04:22 +01:00
Demon
51c25010b5 Merge "Removed READ_LATEST default from Revision::newFromTitle()." 2012-10-15 14:57:02 +00:00
daniel
09c607f7b9 Silence warnings about deprecation by ContentHandler.
The introduction of the ContentHandler caused quite a few functions and hooks to
become deprecated. Usage of these has been removed in core, but is still present
in extensions. Extensions should be fixed after ContentHandler has settled in a
bit, but for now we need a way to silence the warnings.

Change-Id: Ia223243222675f778e8f8c32923f956790db0b4f
2012-10-12 14:56:02 +02:00
Aaron Schulz
63c82eeed7 Removed READ_LATEST default from Revision::newFromTitle().
Change-Id: I12bc0285147fff8d6f523a38950cf3f3cb51933f
2012-10-09 16:35:51 +00:00
IAlex
d29e334c63 Merge "Removed READ_LATEST default from Revision::newFromPageId()." 2012-10-09 16:21:14 +00: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
daniel
bb51a58e57 Cleanup of Wikidata branch.
This cleans up several issues raised in comments to I3b2dad3a,
mostly style and merge artifacts.

Change-Id: I99f5e300a671db1353db151cd187ffd2e4478d03
2012-10-08 17:34:47 +02:00
daniel
7db9491d89 set mediawiki version number
Change-Id: I3479776bd3bb25c4d75d07e62ede2ad989025c5b
2012-10-05 15:03:24 +02:00
Aaron Schulz
402da95a4b Removed READ_LATEST default from Revision::newFromPageId().
Change-Id: If3feb424314be5db88cb0f25c0358b3be4cad572
2012-09-26 13:40:18 -07:00
daniel
b6b686c13b merged master
Change-Id: I0ef7c7f33a5dc5855f38b20c03ddc5306f38ec66
2012-09-19 12:34:10 +02:00