| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In T340552, the official PHP OpenTelemetry client was effectively
rejected for inclusion in MediaWiki due to its size. Implement a minimal
tracing library instead that eschews conformance with the OTEL client
specification in favor of simplicity, while remaining capable of
emitting trace data in OTLP format and thus retaining compatibility with
any ingestion endpoint capable of handling OTLP.
In its current state, the library supports a basic feature set that
should be sufficient for basic tracing integration:
* Span creation, inclusive span activation and automatic parent span
assignment,
* Span attributes and span kinds,
* Basic resource (process/request)-level metadata generation,
* Data export over OTLP.
Additional functionality, such as trace propagation, can then be
incrementally added to the library.
Bug: T340552
Change-Id: Ibc3910058cd7ed064cad293a3cdc091344e66b86
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parsoid abstracts the specific DOM implementation it is using, in
practice (currently) using subclasses of the built-in \DOMDocument
classes using the \DOMDocument::registerNodeClass() mechanism.
Parsoid's own phan configuration uses stubs for its abstract DOM
classes to encourage the use of "standard" DOM methods -- but core
doesn't use Parsoid's phan configuration and doesn't really understand
the way that ::registerNodeClass() works and so get confused by code
such as:
$el = $document->createElement('div');
In actual practice this is a Wikimedia\Parsoid\DOM\Document (a
subclass of \DOMDocument) which creates a
Wikimedia\Parsoid\DOM\Element (a subclass of \DOMElement) via the
::registerNodeClass() mechanism, but phan sees only the base
\DOMDocument::createElement() signature and assumes this creates a
\DOMElement *not* a Wikimedia\Parsoid\DOM\Element. If you do
"element-y" things on this, phan has no complaints, but if you pass
this back to a Parsoid method which expects the abstract
Wikimedia\Parsoid\DOM\Element type then phan (spuriously) complains.
This type error can be hard to understand.
Workaround this issue by simply aliasing Parsoid's abstract DOM types
to the built-in \DOMDocument etc types. The alternative would be to
use Parsoid's stubs, but it seems cleaner (for now) to avoid reaching
into
vendor/wikimedia/parsoid/.phan/stubs
to get them.
Change-Id: I90b33c5d65bde1582be9a452a144808b6d53d914
|
|
|
|
|
|
|
| |
Fixed SkinModuleTest::provideGetFeatureFilePathsOrder as nesting of
arrays for parameters is wrong
Change-Id: I9875008adf62d284c48662ebfbd245d72e5be064
|
|
|
|
|
|
|
| |
No longer used.
Bug: T75714
Change-Id: I2b097671716fabec169bc803da98cd0340d70cc4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Remove docs for unchecked exception (T321683).
* Remove use of MWException, prefer more specific type (T86704).
* Remove use of AtEase (T253461).
* Merge `is_dir||mkdir||is_dir` into one check to more clearly express
that our success criteria is explicitly one or the other, with
a repeat for race conditions. This makes them not seem like unrelated
checks or early returns, rather than the main code.
This also fixes the seemingly unintentional difference where one
check was before normalized $dir and one after.
* Use native trigger_error() directly as does not add value to use
MWDebug::warning() with merely the default parameters. The last
edge case was $wgDebugToolbar which got fixed with I62d864823ec8a.
Change-Id: Ic44798299a64f902decbc4cf2dbf2206a96c3837
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make sure that taint-check knows about these methods, especially as we
move the taintedness info from the plugin to annotations on the methods.
Some tests are currently disabled because they would fail. These will
be enabled in subsequent commits while adding annotations to the
relevant methods.
Note that the disabling needs to be done by making the suppression
annotation invalid (done by prepending 'xxx' in this patch), because
commenting out the code or adding a method-wide @suppress won't work.
Bug: T321806
Change-Id: I8b89a22a5c23a2ab25329bcb06c673168d24683d
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was disabled in I51dca12be9c77049f77563d9bf0edd07928c2300. The
rationale is still valid; however, without class_alias support we cannot
add tests for taint-check to verify that it knows about both the old and
the new class names. The benefits of being able to test taint-check
would currently outweigh the benefits of not using aliased classes.
Set enable_class_alias_support to true again, but add a TODO comment
that this should ideally be switched back to false if we can do that
without breaking taint-check tests.
Bug: T321806
Change-Id: I4177c7578cd84ce28d4ca359f73f89b6899bda68
|
|/
|
|
|
|
|
|
| |
Moved to docs/ rather than includes/, update references and remove
from phan exclusion list
Follow-up: I32c034d05bf2354cdaa5f02d19031421cbae78a1
Change-Id: I8d71c29c8cbfa413db47066f00d71783259f0916
|
|
|
|
|
|
|
|
|
|
|
| |
The base phan config uses a file_exists check to determine whether to
use the namespaced class name, but it doesn't work when running against
core because MW_INSTALL_PATH isn't set. So specify the type in the local
config, and remove @phan-var annotations added in I6bbdbbe6.
Also use `::class` instead of string literals for classes.
Change-Id: I994a0ed32ea948253ed07ee3cc8868a0eaa6d8b9
|
|
|
|
|
|
|
|
|
|
| |
And namesapce them:
- StreamFile
- OutputHandler
- OutputPage
Bug: T321882
Change-Id: Iedf8d88c595e580f2d8f0734c92aa5c45618ba33
|
|\ |
|
| |
| |
| |
| |
| | |
Bug: T341754
Change-Id: I17396985d0b26516a06df17e9bd1343054521e01
|
|/
|
|
|
|
|
|
|
| |
Last updated for php-excimer 1.0.4, which is missing
getSpeedscopeData(), as used by excimer-ui-client and in examples
on mediawiki.org.
Bug: T266626
Change-Id: I7f0c86f83cbe3b0378648003a66fcb86da8d7828
|
|
|
|
|
|
|
|
|
| |
No longer needed since 5ceaf8a5d45ba868, which added the
symfony/polyfill-php81 requirement to composer.json.
This reverts commit 7534655922f15f961910aadb41bbe58d2fce1039.
Change-Id: I860f11180fe26c4626c467bdd298013236d70ad1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We always wrap the local cluster cache, and there are no subclasses
of WANObjectCache. It was never documented or recommended how these
would be used. It is a left-over from the original 2015 Multi-DC plan
in which WANObjectCache would work differently. See task for details.
Note that this requires no configuration changes, even in the
theoretical case of these variables being used, as the only
option is to use the main cache, and that's also the default.
* Update WAN overrides to override the underlying main cache
instead.
* Fix EditPageTest which was previously implicitly using a 'hash'
as main cache but also relying on wan cache to be 'none'.
The part that it actually needs is the 'none'. When WAN cache is
enabled, testUpdateNoMinor fails due to an edit conflict because
one of the edits it makes is made with a current timestamp whereas
it expects to simulate wpEdittime in the year 2012 which, when
caching is enabled, is ignored and becomes the current time instead.
I don't understand exactly why, but I'm going to conserve that
behaviour for now.
* Fix TemplateCategoriesTest, which was failing due to an unexpected
cache hit:
> [objectcache] fetchOrRegenerate(…:page:10:…): volatile hit
This could be solved in a more realistic way by splitting the test,
or by explicitly resetting services half-way the test to clear
WikiPageFactory, PageStore and WANCache process state.
For now, keep the prior behaviour of no cache in this test.
Bug: T305093
Bug: T329680
Depends-On: If890622eed0d0f8b4bd73d36ba1815a3d760ea05
Depends-On: Ie1def75208822bdf19bb2cfd7e6edf32c2000e6b
Depends-On: I35cce61dc3ee90dcee3dd6f0b36f84133be029ed
Change-Id: I53781a8c06ebb2583f6ca83dd91bbfe8a5c88b13
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is moderately messy.
Process was principally:
* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
xargs rg --files-with-matches 'Title\b' | \
xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix
Then manual fix-ups for a few files that don't have any use statements.
Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use a WeakMap to track references to TempFSFile instances if available
to avoid deprecation warnings for dynamic property creation on PHP 8.2.
Use an anonymous class rather than an stdClass to test the behavior in
TempFSFileTestTrait to verify that bind() does not trigger dynamic
property creation on PHP 8.2.
Also add a Phan stub for WeakMap for PHP 7.4.
Bug: T324894
Change-Id: Ic413c115e9ed1c750e175152094f3309628e777a
|
|
|
|
|
|
|
| |
ReturnTypeWillChange is new in php8.1
Allow to run phan under php80 with a stub
Change-Id: Ib84b314bf495634583b625ed8d7530908286e839
|
|
|
|
|
|
|
|
|
| |
Also remove two vendor/* entries from exclude_file_list; besides the
fact that one is a .inc file, both are part of dev dependencies, which
are ignored after 3253cbf8d5e1826f.
Bug: T184782
Change-Id: I0e0fac176b1c085e106533bcf3e8e3dcc75cd65a
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This branch fails to compile against PHP 7.4.3, our lowest supported
version, and will not be updated to support that or any newer version:
https://tideways.com/profiler/blog/releasing-new-tideways-xhprof-extension
In doing so, remove the Xhprof class. At this point, it doesn't do
anything other than calling either of two functions from whichever
extension is installed, which can just be done in ProfilerXhprof.
Change-Id: Iba1c16f47c68b36982f5d2dcda3bdf4dcb83501d
|
|
|
|
|
|
|
|
|
| |
* dom: This PHP extension is an installation requirement so should
always be available.
* oci8: Oracle support was removed in 1.34 (4d10bb14e81aadb9).
* sqlsrv: Likewise for Microsoft SQL Server.
Change-Id: Id53f4ce477a19cff0063d3d60a405647249e7202
|
|
|
|
|
|
|
|
|
| |
The only reference to ValueError (added in a80631ea0ca8ad6a) was removed
in 47241a3520d5b4bf. Regardless, the stub is redundant to the one that
is part of the symfony/polyfill-php80 library, which is already listed
in composer.json as a required dependency.
Change-Id: Ic9aa3e36d24bf79fb21ab37dd177e28f8176f573
|
|
|
|
|
|
|
|
|
|
| |
Since ee5a9b788a2fa3d9, pear/mail and pear/mail_mime are installed by
Composer along with the other required external libraries, so these
classes should exist in all installations.
Also removed the Phan stub for the same reason.
Change-Id: I6e545bf9fab15a66d1ea7bdf697908e7b1066897
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In PHP 7.4, it's possible to compile password without Argon, but if
Argon is compiled in, both algorithms should be available.
So:
* Remove Phan stubs
* Simplify class code
* Add test per todo
Change-Id: I749d456ad59698e5b1538b127586ea796efba1d1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Indirect dependencies are typically needed only by the direct
dependencies, which are not analyzed.
Dev dependencies are needed to run Phan, but are not needed in the code
Phan is analyzing.
So it turns out to be fairly straightforward to eliminate unnecessary
dependencies from the Phan parse stage, reducing memory usage by about
40% and time usage by about 20%. This means I can run Phan on my laptop
without first closing PHPStorm, which is convenient.
As a matter of policy, you could argue that the list of allowed indirect
dependencies here should be explicitly declared by moving them to
composer.json.
Change-Id: I987c3b22bafd1b4332fdeaf40ec3e20d35a3d929
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ForkController, OrderedStreamingForkController: indeed pcntl_fork()
can't return false.
* RL\Image: Specify type instead of using suppression, since the issue
name changes.
* VueComponentParser: Accept complaint about nullable nodeValue.
* Disable PHP 8.0 polyfill stubs when running on PHP 8.0+ to avoid
duplicate interface errors.
* Add Socket stub and use it in LegacyHandler instead of multiple
existing suppressions.
* MemcachedPeclBagOStuff: accept complaint recommending !$result over
$result === false when the type is boolean.
* MemcachedPeclBagOStuff: fix probable bug, ignoring errors from
Memcached::getMulti(). Phan noticed that $res=false was unreachable,
but it should probably be reachable.
* DatabaseMysqli: accept complaint that $this->conn->errno is already
known to be an int. It was probably a hack for some previous version
of Phan.
* BcryptPassword, MWOldPassword, MWSaltedPassword: accept complaint that
the !is_string() checks are unnecessary, after code review of PHP.
* Pbkdf2PasswordUsingHashExtension: note that contrary to Phan's
suggestion, this check is necessary.
* DefaultPreferencesFactory: remove an existing hack for
array_diff_key(), no longer necessary on 7.4 and causes an error on
8.1. Use coalesce instead of cast for the remaining
array_intersect_key() hack since it better shows that we are casting
away null.
* FullSearchResultWidget: fix likely bug involving strict comparison
between a float and an int.
* SpecialWatchlist: accept complaint that $selectedHours is
unconditionally a float, being the return value of round(), and thus
the cast is unnecessary.
* Add stub for AllowDynamicProperties, resolving an error in User.php.
* Xml: accept complaint that $encMonth is already known to be an int.
Six errors remain. These need suppressions or otherwise conflict with
PHP 7.4 support.
Bug: T322278
Change-Id: Ie375bbc8ccf22330b9a169e8da98f2bbe26ec8b9
|
|
|
|
|
|
|
|
|
| |
This reverts commit 2bdc0b2b7209441a42a784157633a8a01b321922.
Reason for revert: T166010#8349431
Bug: T166010
Change-Id: Idcd3025647aec99532f5d69b9c1718c531761283
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moving:
- DerivativeRequest
- FauxRequest
- FauxRequestUpload
- PathRouter
- WebRequest
- WebRequestUpload
Bug: T166010
Change-Id: I5ea70120d745f2876ae31d039f3f8a51e49e9ad8
|
|
|
|
|
|
|
|
| |
This is not needed after ef8c6b086e2c9399 in mediawiki/tools/phan,
and the "approximate error count" in the comment is out of date
after 43a93d9782bee485.
Change-Id: I9c6749c981140227296e592f857f095bfb4ed29f
|
|
|
|
|
|
|
| |
Temporarily disable PhanPluginDuplicateExpressionAssignmentOperation
Bug: T319186
Change-Id: I8ae3f74f482b5de3dd74471c2e853386d1fe1091
|
|
|
|
|
|
|
| |
Removes various hacks and back compat support
Bug: T270740
Change-Id: I17d74705cdd5a2e1af0bda66bfa466067b8387a8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
see T298571
This failure only shows up for php 7.4 since that is using
dbal 3.x.x while php 7.2 is using dbal 2.x.x
Phan analysis is being disabled for those files for php 7.2
since those are now failing with 'unused suppression' and
php 7.2 support is going to be dropped in the near future,
so that doesn't matter to much.
Bug: T316518
Change-Id: I74da37dc4329a7dd2c015a9d1fc7037a866f40c9
|
|
|
|
|
|
|
|
|
| |
Run phan over classes in tests/parser
The dependency of classes between parser and phpunit is not clear.
Classes used by both possible needs part of /common/
Change-Id: I2ceca6b7cd447876c127ed3b14e09f479defbd93
|
|
|
|
|
| |
Bug: T300129
Change-Id: I1e83a0dde6235bed91d28d7d43691c6a5d979f2f
|
|
|
|
|
|
|
|
|
|
|
| |
DefaultSettings.php has been replaced by MainConfigSchema.
Loading DefaultSettings.php is deprecated.
Code that needs to have access to configuration defaults should use the
ConfigSchema service object.
Bug: T300129
Change-Id: I7b2c0ca95a78990be1cdb9dd9ace92f6dcf1af15
|
|
|
|
|
| |
Bug: T282133
Change-Id: I31f52d26bc022c77e50db42ac80c7dbe1a37c8e6
|
|
|
|
|
|
|
|
|
|
| |
* Remove the fallback code in ImagePage, it is possible to call
getImageLimitsFromOption non-statically in this situation
* In OutputPage replace the call to trait function to one class
implementing the trait
Bug: T289813
Change-Id: I166a53615fb2be6e3d8b48489ce342e48435dfc3
|
|
|
|
|
|
|
|
|
| |
Make phan stricter about conditional variable declaration
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T259172
Change-Id: I1f200ac37df7448453688bf464a8250c97313e5d
|
|\
| |
| |
| | |
minimum_target_php_version"
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
MediaWiki still supports PHP 7.2+, but we want to mainly test in newer versions
of PHP. Setting minimum_target_php_version to 7.2 this lets us run phan without
phan trying to get us to make PHP 7.2-incompatible changes to 'appease' PHP 8.0
or whatever later changes.
Some switches of generic 'resource' type-hinting to 'resource|object' to inform
phan to ignore this (triggering PHPCS at the time, ah well), rather than trying
to hint the specific novel PHP encapsulation classes to that have replaced them
from PHP 8.0 onwards but don't yet exist, and fixes from where we were checking
the results of implode and explode.
Bug: T293924
Change-Id: I629e3fb3adfad73beb3d424a07e643c2e079d9bb
|
|/
|
|
|
|
|
|
|
|
|
| |
Make phan stricter about array keys
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T304887
Depends-On: I3105a5fd4826f8667b5232834defc5ec93be32a1
Depends-On: Ie9610a6e83731468311edb3ed17f80fc509de385
Change-Id: I701f12ab94478c3b8e7fd82110ade74a8e6b04ef
|
|
|
|
|
|
|
|
|
|
|
| |
Make phan stricter about null types by setting null_casts_as_any_type to
false (the default in mediawiki-phan-config)
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T242536
Bug: T301991
Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
|
|
|
|
|
|
|
|
|
| |
Make phan stricter about scalar types by setting scalar_implicit_cast to
false (the default in mediawiki-phan-config)
Bug: T242536
Bug: T301991
Change-Id: Ia2fe30b17804186571722e728578121c8b75d455
|
|
|
|
|
|
|
|
|
|
| |
This helps phan to detect unreachable code and also impossible types
after the functions.
It helps phan to avoid false positives for array keys
when the keys are checked before
Bug: T240141
Change-Id: I895f70e82b3053a46cd44135b15437e6f82a07b2
|
|
|
|
|
|
|
| |
Addition and remove of suppression needs to be done with the version
update.
Change-Id: I3288b3cefa744b507eadebb67b8ab08c86517c1c
|
|
|
|
|
|
|
| |
Suppress false positives
Bug: T240141
Change-Id: Ie356512ad76de465b1fda5b913fa30702339cb11
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a bug fix release of RemexHtml, required by the latest version
of Parsoid.
RemexHtml migrated to a new namespace in 2.3.2. Since we don't
support aliases in our phan configuration in core, update all uses to
the new namespace to satisfy phan.
Depends-On: I30f01f4a2a5479bb82c9b952ffa68a478215828a
Depends-On: Iedf446635ee2112cfe637d8ebcf8092f0976bd17
Change-Id: I74fc929e4a66b28bfb1800ff0cd751c86e4a9f50
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a bug fix release of RemexHtml, required by the latest version
of Parsoid.
RemexHtml migrated to a new namespace in 2.3.2 and uses aliases for
compatibility. Once we upgrade mediawiki-vendor we can rename all
the uses in core and turn off aliases again.
Due to T287419, we need to suppress some phan issues because phan
ends up running against both remex 2.3.1 *and* 2.3.2 in different
CI jobs. These suppressions are removed in the follow up
I74fc929e4a66b28bfb1800ff0cd751c86e4a9f50.
Change-Id: I42edd4fb8cd277ea20e331994fcbe56b52bf3f06
|