All the magic functions needs public visibility to be callable from php
internals like garbage collector
Change-Id: I1baf04bf8ff787da880d46e4a6daa77f5a6de73f
This code is functionally identical, but less error prone (not so easy
to forget or mix these numerical indexes).
This patch happens to touch the Parser, which might be a bit scary. We
can remove this file from this patch if you prefer.
Change-Id: I8cbe3a9a6725d1c42b86e67678c1af15fbc5961a
In a nutshell:
This commmit removes the use of drifting microtime()
in favour of non-drifting time(). Then, we increase the size of
the counter by x1000, and consider every 1000 increments as 1ms
for the purposes of UUID.
Why:
This means we eliminate the whole code that can produce a fatal
exception when the clock drifts by more than we can wait for,
which puts us in a logical conundrum we can't get out of, hence
it previously fatalled.
Not aborting random end-user requests and jobs is good.
This also means we avoid the vast majority of cases where
MediaWiki would busy-loop for upto 10ms in a likely-to-fail
attempt to sync the clock. This means the method runs faster,
which is a nice win, albeit not the main objective.
Bug: T94522
Change-Id: Ia8a847078ec76d633854db6823a20f0961c80f80
Various miscellaneous clean ups with no change to any of the
logical code. This to make the next commit have a cleaner diff
for easier review.
* Make internal millitime() non-static.
* Improve documentation and add missing @covers annotations.
* Correct getTimestampedID88() documentation to state that
only two values need to be passed, not three.
This is significant because the Flow extension is actually
using this method in a subclass and passes only two values.
Bug: T94522
Change-Id: I2a0c51bea58df4cc0c253c1c10de3ac383f04c8e
It was never super popular anyway, APC was always the best option.
The project has no plans to move to PHP7, so it's quickly reaching
its end of life. Oh, and Fedora dropped it from their repos 2 years
ago.
Change-Id: Ia3257e86a6323d8943f04a5c05c72c0bd4c4b0a9
phpdbg is a gdb-style debugger for PHP that is run from the command
line. However, it has a different PHP_SAPI value, so it was impossible
to run maintenance scripts with it (until now).
To avoid having to check both PHP_SAPI values in a bunch of places,
introduce wfIsCLI() to easily check whether running from the
command-line or not.
We're (CI team) interested in generating code coverage with phpdbg
instead of xdebug, hence this patch.
Bug: T184043
Change-Id: Id1f994ca146d7858cd8bb6ab6cdbb7718ff524fb
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.
Also update some defect links.
Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
This fixes the outstanding mis-spaced cast operators to bring them
into line with the coding standards on mediawiki.org (and with the
more common usage within this codebase).
Bug: T149545
Change-Id: Ib7bcf95bbee83d20c05f6d621ce7b4e1fb58a347
* Use services container in more places.
* Undeprecated getLocalServerInstance() since $fallback is not
handled elsewhere.
Change-Id: Id1fcd1c465d2d92653357523f4225f1c4d1ace2f
* 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
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
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
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
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