Commit graph

89 commits

Author SHA1 Message Date
James D. Forrester
9635dda73a includes: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
2017-02-21 18:13:24 +00:00
Erik Bernhardson
d67197fa11 Cleanup some incorrect return annotations
Most of these are simply changing annotations to reflect
reality. If a function can return false to indicate failure
the @return should indicate it.

Some are fixing preg_match calls, preg match returns 1, 0 or false,
but the functions all claim to return booleans.

This is far from all the incorrect return types in mediawiki, there
are around 250 detected by phan, but have to start somewhere.

Change-Id: I1bbdfee6190747bde460f8a7084212ccafe169ef
2016-12-12 10:15:05 -08:00
Aaron Schulz
950cf6016c Rename DB_SLAVE constant to DB_REPLICA
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
2016-09-05 22:55:53 -07:00
Reedy
b5656b6953 Many more function case mismatches
Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
2016-03-19 00:20:58 +00: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
Kunal Mehta
f6e5079a69 Use mediawiki/at-ease library for suppressing warnings
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.

Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.

Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.

Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
2015-06-11 18:49:29 +00:00
Stephan Gambke
f09e458d39 Fix for Ia9baaf0b: Make previously public variables public again
Change Ia9baaf0b changed the visibility of member variables (many of which are not
otherwise exposed, e.g. by a method) and by that introduced a major API change
breaking extensions.

This patch explicitly marks affected variables as public again, keeping the intent
of the original patch of making phpcs-strict pass on includes/ directory.

Bug: 67522
Bug: 67984
Change-Id: I498512b2a1e615365bb477c1fd210aaa3241ca03
2014-08-29 23:01:53 +02:00
umherirrender
1c68a1ee86 Cleanup some docs (includes/*.php)
- 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: I783e4dbfe5f6f98b32b9a03ccf6439e13e132bcc
2014-07-24 19:42:24 +02:00
Kevin Israel
6ca760a5ba Revert more visibility changes in HistoryBlob.php
This follows-up bebcf2c583, which only fixed DiffHistoryBlob.

MediaWiki will fail to load some revisions if the following properties
do not unserialize correctly:

* HistoryBlobStub::$mOldId
* HistoryBlobStub::$mHash
* HistoryBlobCurStub::$mCurId

Visibility of HistoryBlobStub::$mRef is also restored; though the
property's value does not appear to be used after unserialization,
the property is nevertheless a serialized property.

Bug: 65665
Change-Id: I2724d15f9206d66d615d020117e60bb772048c19
2014-05-25 17:09:40 -04:00
Brad Jorsch
bebcf2c583 Revert visibility change on DiffHistoryBlob::$mCompressed
Changing the visibility from public to protected causes unserialization
to fail.

Bug: 65665
Change-Id: Id7ee2068749ff421fab4d1c9067763adf4b89563
2014-05-23 11:06:06 -04:00
Siebrand Mazeland
a7fbdd6503 Make phpcs-strict pass on includes/ (7/7)
Change-Id: Ia9baaf0b3cdbe1a3c6b50ef8c4fe86fead88f909
2014-05-15 20:07:09 +02:00
umherirrender
a3983418d5 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: I0056b4a8df243cfc0c5f25378de48f7a35170aca
2014-04-22 13:07:02 +02:00
umherirrender
4c81a710fa Fix formatting of some php docs
php docs of functions should have newline in it and not in one line.

Change-Id: If4a29aefb46a7f73d75593814e597fdb792d5470
2014-03-15 20:49:55 +00:00
Kevin Israel
d3fa5a3716 HistoryBlobCurStub: correct setting name in doc comment
It is $wgLegacySchemaConversion = true that causes these to be
inserted into the text table when upgrading from 1.4 or earlier,
and this is the only occurrence of $wgFastSchemaUpgrades even on
the REL1_5 branch.

Change-Id: I57634343d3515a4fb982c648e22ad23c2af0f2f6
2013-10-27 01:10:12 -04:00
Kevin Israel
7751b289e4 DiffHistoryBlob: don't check for mhash extension
Checking for the mhash extension is pointless in PHP 5.3+ because
it only exists as B/C functions that are part of the hash extension.

From ext/hash/config.m4:

    if test "$PHP_MHASH" != "no"; then
      if test "$PHP_HASH" = "no"; then
        PHP_HASH="yes"
      fi

      AC_DEFINE(PHP_MHASH_BC, 1, [ ])
    fi

So if mhash() is compiled in, hash() must also be compiled in.

Change-Id: Ic376f4c438aaf701ebb4f1394ab6e4c1803fb8b8
2013-07-30 11:44:03 -04:00
umherirrender
6f79eef473 Fixed spacing around parenthesis in includes
Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397
2013-04-28 15:50:07 +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
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
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00
Platonides
3d50658e6d Remove orphan call to wfProfileOut()
Also added spaces on line 247 per coding conventions.

Change-Id: Ib63167d4371ac71ce7580fafefdb0eabc2e0b590
2013-01-06 19:38:19 +01:00
umherirrender
9d19d7342a Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I7db616db8c969567d420c0161fa207b366e292b6
2012-10-19 22:03:05 +02:00
Alexandre Emsenhuber
15e9fcca01 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Iaebd4e253ff3b35b568e9b394231a5691445ac95
2012-05-14 19:59:58 +02:00
Tim Starling
346181cce1 Clarified comment per CR r111701 2012-02-17 00:28:17 +00:00
Tim Starling
e1ee5c469b (bug 34428) Fixed hash mismatch errors in DiffHistoryBlob::patch() by simulating LibXDiff's broken Adler-32 implementation. 2012-02-16 23:27:00 +00:00
Tim Starling
f9cecd0be8 Temp patch for bug 34428, merged from 1.19wmf1 r111602 2012-02-16 00:51:10 +00:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Aaron Schulz
5a6559d8b1 Reverted r108743 per CR comment. This should at least be discussed first. 2012-01-12 19:41:18 +00:00
Sam Reed
a5c200a25b Kill "* @return void" 2012-01-12 19:12:24 +00:00
Tim Starling
68aefb8b01 Revert r89925, setting disable_functions in php.ini is definitely the wrong way to fix hash mismatches. 2011-06-14 06:07:20 +00:00
Ariel Glenn
e78187eba2 safer check if mhash is available (and I'm about to make it unavailable by disabling the fn in the php.ini for lucid builds) 2011-06-12 12:02:53 +00:00
Alexandre Emsenhuber
678482beaa Removed some usage of error suppression operator 2011-06-09 19:52:07 +00:00
Sam Reed
4c29198850 And some more.... 2011-05-28 17:51:33 +00:00
Sam Reed
3614ecfffb And more documentation. Yaaaay 2011-05-28 17:18:50 +00:00
Sam Reed
08522e70d6 Change old php4 style constructor 2010-12-15 22:41:06 +00:00
Sam Reed
7bff03b3ad Remove public from interface defintion, as decleration in an interface is not valid 2010-12-15 11:30:54 +00:00
Chad Horohoe
9e6c7cc8ef Get rid of PHP4-style constructors 2010-08-30 16:52:51 +00:00
Platonides
69747f93ba Convert $wgBlobCache into a static class member.
static members don't influence serialization.
2010-08-12 18:43:06 +00:00
Alexandre Emsenhuber
5ff5719800 * Fixed some doxygen warnings
* Documented a bit
2010-02-27 21:09:15 +00:00
Tim Starling
42e9d810b6 Use xdiff_string_rabdiff() instead of xdiff_string_bdiff() 2008-12-29 08:43:01 +00:00
Tim Starling
79478bb117 Convert from old DiffHistoryBlob format. Untested, committing for test by Jelte. 2008-11-01 21:38:46 +00:00
Tim Starling
225ff51e09 Implemented xdiff_string_bpatch() in pure PHP, allowing DiffHistoryBlob objects to be decompressed without libxdiff. Negligible performance difference. This provides a stability guarantee -- if libxdiff disappears or changes, we can continue to read old blobs. It also means we don't have to package libxdiff for all app servers. 2008-11-01 13:36:08 +00:00
Tim Starling
c924b2c3a1 New DiffHistoryBlob storage format and compression method, which maintains a good compression ratio in the case of vandalism by replacement with small text. The storage format allows edit wars to be dealt with as well, but an efficient algorithm for that may be more difficult. 2008-11-01 09:39:40 +00:00
Tim Starling
0922f54539 * Added recompressTracked.php, the second part of the recompression project. Uses the sorted list of blobs compiled by trackBlobs.php to recompress the entire contents of a set of external storage clusters to a new set of clusters, and updates the text table accordingly.
* Tweaked blob_tracking indexes now that I know what I'm doing with them
* Standardised isHappy() on no arguments. Use an uncompressed size limit instead of the weird things I did originally.
2008-10-29 15:15:29 +00:00
Tim Starling
e48a9beb8e Revert revert r41578 of r41531 and fix compressOld.php. 2008-10-17 09:11:43 +00:00
Brion Vibber
2946cdcaaa Backing r41531 out for now ("Concept for diff-based compression using the new xdiff beta")
Looks cool, but this changes the return type of ConcatenatedGzipHistoryBlob::addItem() from a stub object to a hash value, which will break its usages in ConcatenatedGzipHistoryBlob::setText() and maintenance/storage/compressOld.inc.
2008-10-03 00:00:24 +00:00
Tim Starling
30ea5f2d8b * Concept for diff-based compression using the new xdiff beta. Acheives massively better compression ratio compared to CGZ for articles which are larger than the deflate 32 KB sliding window. Works within the HistoryBlob architecture.
* Fixed documentation in HistoryBlob.php, removed "todo document" for methods that are adequately documented in the interface.
* Added testCompression.php for testing concatenated object compression ratio
2008-10-02 06:32:14 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00