| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Syntax supported since 26235c73
Change-Id: I397c76d4aba753a1629383559b95df86514f19ff
|
|
|
|
|
|
|
|
| |
Both deprecated in 1.39 and hard-deprecated. Unused in production and
allow us to clean up dependency of ApiQuery to LB.
Depends-On: Ia94618b7f58fcca72e903fd2e2e9f0aaa501ac24
Change-Id: Ie0322e5346b94932a2eddc0b7aad5a384768b888
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
Patch Ifa7a9bc replaced some longer `=== null` constructs with the
new ??= operator we have since PHP 7.4. However, some of these can be
simplified even more with the ?? operator we have since PHP 7.0.
Follow-Up: Ifa7a9bc7b2ec415ad7ecb23f4c1776f51f58fd6b
Change-Id: I7b05e723810558bb5437adc97eab54ca04d38c06
|
|
|
|
|
|
| |
New feature from PHP 7.4
Change-Id: Ifa7a9bc7b2ec415ad7ecb23f4c1776f51f58fd6b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Rdbms library already takes care of caching and re-using connections
nowdays. Perhaps in a past where DBConnRef was less common or not
yet created this made sense, but we've now adopted that universally.
I don't know of a current use case for WMF, given the removal of
non-vertical query groups in T263127 (e.g. we keep "api" for all API
traffic, but not e.g. something individual classes would change).
For now I've documented that in someone does run into this, perhaps
in third-party code, that we recommend instead to override getDB()
instead of relying on this central mechanism. E.g. overriddet getDB()
to return `wfGetDB(DB_REPLICA,'mygroup')`.
Bug: T263127
Change-Id: I4c3cc7868f1f4210ee655541eb6a45705c643c70
|
|
|
|
|
|
| |
It has been deprecated since 1.35 and it is unused.
Change-Id: I27848626f5457dd41726a25520dcf2459b35e95a
|
|
|
|
|
|
| |
It has been deprecated since 1.34 and it is unused.
Change-Id: I5c879fd3bedef807181b503663b68e3c2956e120
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Found by phan strict checks
Change-Id: I2b2ae12ca39d67140f0f3c1cc5066c8ef72716de
|
|
|
|
|
|
|
|
| |
Nothing to learn from these.
You can find a longer explanation in the comments in I93751e6.
Change-Id: I195aae70fc282b58be5b18160783f27d38605d15
|
|
|
|
|
| |
Bug: T254646
Change-Id: I2b120f0b9c9e1dc1a6c216bfefa3f2463efe1001
|
|
|
|
| |
Change-Id: I6d0577124d852103f485ffdc819876a13f6641c3
|
|
|
|
|
|
| |
Avoid global HookContainer and use the local one
Change-Id: I6448915f478015d7f790e1fc0f6c3653917a138f
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.
Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
|
|
|
|
|
|
|
|
| |
The web interface of MediaWiki honors this, but the API interface
does not. This patch makes them consistent.
Bug: T277358
Change-Id: Ia51e8c6a09a999d3fc6b29eea56a682fa8229ffd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replaces calls directly to PermissionManager with calls to
the Authority object available from Context or the
GroupPermissionLookup service.
This patch does not address use of PermissionManager for
blocks.
Deprecations:
- ApiBase::checkUserRightsAny deprecated passing optional
User parameter
- ApiBase::checkTitleUserPermissions deprecated passing
LinkTarget as first parameter, takes PageIdentity instead
Bug: T271462
Bug: T271854
Change-Id: I5d7cac1c28a37e074750c46cda03283980a07fca
|
|
|
|
|
| |
Bug: T208776
Change-Id: I7e71ffc209465b7cca385603d844cd40178485a9
|
|
|
|
|
|
|
|
| |
Make ApiQueryBase::addOption() annotation consistent with
SelectQueryBuilder::option() since the ApiQueryBase method
is just a wrapper to it.
Change-Id: Ib301bce787c8ba89ae8333eb7cfb8d7d287de20c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PHPStorm can use custom folding regions defined in either the
VisualStudio style or the NetBeans style. The VisualStudio style is more
pleasing to the eye and also works as a vim foldmarker. So get rid of
the previous vim foldmarkers, and use region/endregion.
region/endregion need to be in a single-line comment which is not a doc
comment, and the rest of the comment is used as a region heading (by
both PHPStorm and vim). So to retain Doxygen @name tags, it is
necessary to repeat the section heading, once in a @name and once in a
region. Establish a standard style for this, with a divider and three
spaces before the heading, to better set off the heading name in plain
text.
Besides being the previous vim foldmarker, @{ is also a Doxygen
grouping command. However, almost all prior usages of @{ ... @} in this
sense were broken for one reason or another. It's necessary for the @{
to be in a doc comment, and DISTRIBUTE_GROUP_DOC doesn't work if any of
the individual members in the group are separately documented.
@name alone is sufficient to create a Doxygen section when the sections
are adjacent, but if there is ungrouped content after the section, it
is necessary to use @{ ... @} to avoid having the Doxygen group run on.
So I retained, fixed or added @{ ... @} in certain cases.
I wasn't able to test the changes to the trait documentation in Doxygen
since trait syntax is not recognised and the output is badly broken.
Change-Id: I7d819fdb376c861f40bfc01aed74cd3706141b20
|
|
|
|
| |
Change-Id: I78338d48530f098fa5d36fe84cfd45c0d160f444
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For example, documenting the method getUser() with "get the User
object" does not add any information that's not already there.
But I have to read the text first to understand that it doesn't
document anything that's not already obvious from the code.
Some of this is from a time when we had a PHPCS sniff that was
complaining when a line like `@param User $user` doesn't end
with some descriptive text. Some users started adding text like
`@param User $user The User` back then. Let's please remove
this.
Change-Id: I0ea8d051bc732466c73940de9259f87ffb86ce7a
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For compliance with the new version of the table interface policy
(T255803).
This patch was created by an automated search & replace operation
on the includes/ directory.
Bug: T257789
Change-Id: Ie32c1b11b3d16ddfc0c83a757327d449ff80b2e4
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For compliance with the new version of the table interface policy
(T255803).
This patch was created by an automated search & replace operation
on the includes/ directory.
Bug: T257789
Change-Id: If560596f5e1e0a3da91afc36e656e7c27f040968
|
|/
|
|
|
|
|
|
|
|
|
| |
For compliance with the new version of the table interface policy
(T255803).
This patch was created by an automated search & replace operation
on the includes/ directory.
Bug: T257789
Change-Id: I5ffbb91882ecce2019ab644839eab5e8fb8a1c5f
|
|
|
|
|
|
|
|
| |
This marks API base classes as stable for extending per the
Stable Interface Policy.
Bug: T247862
Change-Id: I164192ba3d013d8bc98a8b9c6db10e3dd1e58b23
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Migrate all callers of Hooks::run() to use the new
HookContainer/HookRunner system.
General principles:
* Use DI if it is already used. We're not changing the way state is
managed in this patch.
* HookContainer is always injected, not HookRunner. HookContainer
is a service, it's a more generic interface, it is the only
thing that provides isRegistered() which is needed in some cases,
and a HookRunner can be efficiently constructed from it
(confirmed by benchmark). Because HookContainer is needed
for object construction, it is also needed by all factories.
* "Ask your friendly local base class". Big hierarchies like
SpecialPage and ApiBase have getHookContainer() and getHookRunner()
methods in the base class, and classes that extend that base class
are not expected to know or care where the base class gets its
HookContainer from.
* ProtectedHookAccessorTrait provides protected getHookContainer() and
getHookRunner() methods, getting them from the global service
container. The point of this is to ease migration to DI by ensuring
that call sites ask their local friendly base class rather than
getting a HookRunner from the service container directly.
* Private $this->hookRunner. In some smaller classes where accessor
methods did not seem warranted, there is a private HookRunner property
which is accessed directly. Very rarely (two cases), there is a
protected property, for consistency with code that conventionally
assumes protected=private, but in cases where the class might actually
be overridden, a protected accessor is preferred over a protected
property.
* The last resort: Hooks::runner(). Mostly for static, file-scope and
global code. In a few cases it was used for objects with broken
construction schemes, out of horror or laziness.
Constructors with new required arguments:
* AuthManager
* BadFileLookup
* BlockManager
* ClassicInterwikiLookup
* ContentHandlerFactory
* ContentSecurityPolicy
* DefaultOptionsManager
* DerivedPageDataUpdater
* FullSearchResultWidget
* HtmlCacheUpdater
* LanguageFactory
* LanguageNameUtils
* LinkRenderer
* LinkRendererFactory
* LocalisationCache
* MagicWordFactory
* MessageCache
* NamespaceInfo
* PageEditStash
* PageHandlerFactory
* PageUpdater
* ParserFactory
* PermissionManager
* RevisionStore
* RevisionStoreFactory
* SearchEngineConfig
* SearchEngineFactory
* SearchFormWidget
* SearchNearMatcher
* SessionBackend
* SpecialPageFactory
* UserNameUtils
* UserOptionsManager
* WatchedItemQueryService
* WatchedItemStore
Constructors with new optional arguments:
* DefaultPreferencesFactory
* Language
* LinkHolderArray
* MovePage
* Parser
* ParserCache
* PasswordReset
* Router
setHookContainer() now required after construction:
* AuthenticationProvider
* ResourceLoaderModule
* SearchEngine
Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
|
|
|
|
|
| |
Bug: T243051
Change-Id: I5bc99ee4b0674a5bc02ff31e3f7182fd7564b848
|
|
|
|
| |
Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
|
|
|
|
|
|
| |
Also add null to the underlying functions used here
Change-Id: I2e45fa449cf4c82d9a0e4323c4ac3ac2155bcadc
|
|
|
|
| |
Change-Id: I189f0949e20b4e4ee130e3c7961635169853aeb4
|
|
|
|
| |
Change-Id: I574d4e261ab986e028c3ce26c4f0ec648b88a2ac
|
|
|
|
|
|
|
|
| |
This updates some code that has been constructing TitleValue directly
to use TitleValue::tryNew or TitleParser::makeTitleValueSafe.
Bug: T200055
Change-Id: If781fe62213413c8fb847fd9e90f079e2f9ffc9d
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When converting a Title object into a string for user or user talk
namespace the gender information are needed.
This patch set improves performance on wikis with gender distinction
like dewiki or ruwiki by combining the fetch of the information into one
query and avoids a query per unique user name.
It also avoids false results for request with apihighlimit, because the
apihighlimit with 5000 is higher than the query max limit of the
GenderCache with 1000
Bug: T200238
Change-Id: Ibe0561b210dbeb654117dad777e839640f51b4e4
|
|/
|
|
|
|
|
|
|
| |
* Identifier case
* Returning a void function result
* Unused variable
* Missing documentation
Change-Id: Ibfd2fc5ae1d91c7c9c6a34bcd4523384d3bca576
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add an utility function
ApiQueryBase::executeGenderCacheFromResultWrapper
GenderCache stops working when there are more than 1000 cache missed
and returning the default value (T200238)
Fill the cache with all needed users avoids this behaviour
and it saves one query per user page.
Change-Id: I911dcb160a7b169091b9e8f66fb3908d0f2a1ba4
|
|
|
|
|
|
|
|
|
|
|
|
| |
For efficient bulk querying, this means that
ApiQueryBase::showHiddenUsersAddBlockInfo() needs to return everything
needed by DatabaseBlock::newFromRow().
Since we're rewriting it anyway, we may as well also move
ApiQueryBase::showHiddenUsersAddBlockInfo() out into a trait of its own.
Bug: T232021
Change-Id: I9c5b17a232ecbfbffefc7e40608cf5684ce8a644
|
|
|
|
|
| |
Bug: T220191
Change-Id: I197b8fadaa93e7b320fc19c10e3e09387fe09ad2
|
|
|
|
|
|
|
|
| |
Covers root includes, actions, api, block, changes,
changetags, diff and PermissionManager itself.
Bug: T220191
Change-Id: Ic027d32f5dd8f4c74865df0c8a9fcf91123c889c
|
|
|
|
|
|
| |
Align the doc stars and normalize start and end tokens
Change-Id: Ib0d92e128e7b882bb5b838bd00c74fc16ef14303
|
|
|
|
| |
Change-Id: If3870e6b8d343dd12390f5155d97edbbe080ac77
|
|
|
|
| |
Change-Id: I0c83783051bf35fe785bc01644eeb2946902b6b2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function results in passing its value to IDatabase::select as first
parameter $table.
The first parameter is documented as string|array, because it can take
more complex arrays:
* Joins using parentheses for grouping (since MediaWiki 1.31) may be
* constructed using nested arrays. For example,
*
* [ 'tableA', 'nestedB' => [ 'tableB', 'b2' => 'tableB2' ] ]
Update the type to allow also passing such complex arrays to this
function
ApiQueryBase::showHiddenUsersAddBlockInfo() is using this format
Change-Id: I8038243545bc1c79a1106ccc3bec7738e63c2e2e
|
|
|
|
|
|
| |
ApiResult::addValue defines mixed for $value
Change-Id: I31881426ce7cb81f6430cccd4252881a154cd161
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method was deprecated in 1.33 and is no longer used.
Usage
=====
https://codesearch.wmflabs.org/search/?q=%5CbprepareUrlQuerySearchString%5Cb&i=nope&files=&repos=
Bug: T220656
Change-Id: I15a476438f3a579db41a43658e13b6ddc4fc62d4
|
|
|
|
| |
Change-Id: I9a97325d738d09370d29d35d5254bc0dadc57ff4
|
|
|
|
|
| |
Bug: T216969
Change-Id: I4c06716c83b69d128f26fa7f68736808aa2d3d64
|