Commit graph

28 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
Matthew Flaschen
aa920550a8 Fix comment; these are the least signifincant bits (LSBs), not MSBs
Change-Id: I0102e4969d95c6392a48d4a5b2f2bec096a828a5
2016-01-21 22:13:22 +00:00
jenkins-bot
e1ae107298 Merge "Remove arbitrary newSequentialPerNodeIDs() $count limit" 2015-12-23 20:57:29 +00:00
Aaron Schulz
5ffaa6ae0d Avoid "Unable to set value to APCBagOStuff" exceptions
* This can happen due to incr/add races. Use incrWithInit()
  instead to handle such cases.
* Also made BagOStuff:incrWithInit() return the new value like incr().

Change-Id: I0e3b02a4cff7c20544a9db2eaabd3f61e5a470b1
2015-12-21 20:41:43 -08:00
Aaron Schulz
45330afebd Remove arbitrary newSequentialPerNodeIDs() $count limit
The increment is done in one step, so there is no real reason
to limit this (e.g. performance). It simply makes errors that
can break things.

Bug: T122068
Change-Id: I3278b4ddfe862f8043b6788b3e82e90be730f68c
2015-12-21 11:16:41 -08:00
Aaron Schulz
fb338573ac Fix PHPDoc for getTimeAndDelay()
Change-Id: I7e5b368d13489afec6df56cdc3e71c2e60e07e20
2015-12-05 14:02:46 -08:00
Aaron Schulz
fc428b1670 Fix IDEA error in intervalsSinceGregorianBinary()
Change-Id: Icc90a3050d5d918176dfbb88636a4d9b742fd4b0
2015-12-05 13:34:45 -08:00
Ori Livneh
f5eba88680 Add UUIDv1 function to UIDGenerator
* Added some more unit tests.

Change-Id: Ieb7e66b1319df2e9c6da1518cc9539f276da1838
2015-12-05 20:14:11 +00:00
Aaron Schulz
2fcafc51a2 Remove MWException use from UIDGenerator
Change-Id: Ib0ad346c6c8c4f515b388f63840db4a03b99facb
2015-11-24 15:42:59 -08:00
Reedy
00c426e3c2 Replace wfBaseConvert with Wikimedia\base_convert
Change-Id: Iadab3d018c3559daf79be90edb23d131729bdb68
2015-11-24 22:51:42 +00:00
Timo Tijhof
8a821011ce Remove getLocalServerInstance try/catch in UIDGenerator and DBLockManager
Follows-up 17c91ad610 in which the exception was removed.

Change-Id: If0c8465d0e04f69f29f3f2602dac7ae4538f7542
2015-11-02 22:16:05 +00:00
Aaron Schulz
17c91ad610 Replace newAccelerator() with getLocalServerInstance()
The name is clearer and more consistent, with simpler arguments.

Change-Id: I7205a99ce033e8b086a52cd02c8a721e99c84b1e
2015-11-02 21:39:08 +00:00
Timo Tijhof
79ce51d1c9 objectcache: Make first parameter of newAccelerator optional
Makes it more convenient to use.

Change-Id: I1e11f7a759bd2816e47d1c2453cbe39b8f44b2f0
2015-08-24 23:43:19 +02: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
daniel
7081228214 Start using the Assert helper class for checking parameters.
This introduces https://github.com/wmde/Assert as a dependency,
as discussed in the RFC T91071.

This change uses assertions to check some parameters in some places,
to showcase the main intended use case for assertions in MediaWiki.

Bug: T91071
Change-Id: I93ac39b7c146f10532e37b51d973b59b9c424b2f
2015-05-11 17:54:07 +00:00
Aaron Schulz
6921770414 Updated some try-catch statements: MWException -> Exception
Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
2015-01-09 17:20:22 -08:00
Reedy
4d9143c7f5 Add lots of @throws
Change-Id: I09d0c13070f966fcf23d2638d8fc1328279a5995
2014-12-24 13:49:20 +00:00
Aaron Schulz
d82ce50741 Fixed UID comment
Change-Id: I2e44bd69f4acafa032e0c4207749008409afcd53
2014-08-27 16:19:11 -07:00
umherirrender
21e0c1c533 Correct variable names in @param to match method declarations
Some @param have a typo in the variable name,
some @param's were in wrong order.

Change-Id: Ie25806831027112b398f6f4a909c59147ac3a5fa
2014-08-13 21:48:28 +02:00
umherirrender
d435aa2c58 Fixed some @params documentation (includes/utils)
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: I9bd4ef370016cbbcce42d2612031a264eb3de61b
2014-07-21 20:58:14 +02:00
Aaron Schulz
211d6062e1 Add some casts for sanity before BagOStuff::add() calls
Change-Id: I6ecb609c88e4fc1ef614e94c551199bd610ca360
2014-06-26 16:25:31 -07:00
Siebrand Mazeland
25f917688c Fix CodeSniffer errors and warnings in includes/utils/
Change-Id: I5e59dd8136fcbd8dc833d7c9f6288656e13df6e9
2014-05-08 21:15:09 +02:00
Aaron Schulz
3a4e66ca92 Handle null file handles in UIDGenerator::_destruct()
Change-Id: I92f874e610b2ea32d34aeb35ddd4069fe0d721fc
2014-04-08 16:13:44 +00:00
Bryan Davis
e68e48c050 Delete UIDGenerator cache files after unit tests
Add a UIDGenerator::unitTestTearDown() method that can find an delete
cache files created by UIDGenerator. Call that cleanup method from the
tearDown() method of the UIDGenerator unit tests.

Bug: 44850
Change-Id: If342586d93bbc2a926af2dc388325dcb7c345e37
2014-04-02 23:58:28 +00:00
Aaron Schulz
8fb1317c59 Use file handle caching in newSequentialPerNodeIDs()
* This is now similar to the other methods in that regard

Change-Id: I36163fa7f1bc13d493df9d77b139a99881d0de45
2014-01-08 09:59:09 +00:00
Aaron Schulz
f8f452554e Added per-node sequential ID method and made SquidUpdate use it
* This replaces a live wmf hack

Change-Id: Ie01fd27386d5d7197968b6a8157b7220ba685f7b
2014-01-03 00:41:33 +00:00
Siebrand Mazeland
655a03d26f Update formatting
Change-Id: I5ec6257295261caab6cb2d9eb9d32ce76cae08a2
2013-11-04 10:29:25 +01:00
Tim Starling
e4bcbe722e Introduce includes/utils directory
These are classes that provide facilities for use by any caller, are
independent of user interface, and have a limited set of dependencies on
the rest of MediaWiki. See the README file for a more precise
definition.

These classes cannot go in includes/libs because of a dependency on the
MediaWiki framework, such as wfDebug() or MWException, but they are
otherwise similar. I thought it would be useful to put them in their own
directory, to make them more discoverable, and as part of a general
program of reducing clutter in the base includes/ directory.

I've probably missed a few classes which could be included here, but the
following classes were considered and were rejected for now:

* Fallback: single caller only
* GitInfo: getViewers() has inappropriate dependencies
* HttpFunctions: depends on configuration, $wgTitle
* PoolCounter: depends on configuration
* CacheHelper: depends on IContextSource, wfMemc()

Also moved a couple of classes into libs/ instead, where that seemed to
be more appropriate.

Change-Id: I274cff805b7d694b728a89b764a049cd62d320fe
2013-11-04 11:00:42 +11:00
Renamed from includes/UIDGenerator.php (Browse further)