| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| | |
Bug: T246412
Change-Id: I07fbaa8d9dfc10bc11bca3f8ea444b3bd393832f
|
|/
|
|
|
| |
Bug: T246413
Change-Id: Ia3187fc8892505fa82989640bee8f35534cbfd2f
|
|
|
|
| |
Change-Id: I299900316c8d3129844a047228cd1c15ae7dff63
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Hard deprecated in 1.35, all callers already updated
Bug: T245707
Change-Id: Ib51ce75fe9f33bca0f097010b0a67b6a158357e9
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A new user right, `delete-redirect`, is added (not given to anyone
by default). At Special:MovePage, if attempting to move to a single
revision redirect that would otherwise be an invalid target (i.e.
doesn't point to the source page), the user is able to delete the
target.
Deletions are logged as `delete/delete_redir2`, and the move is
then logged normally as `move/move`, mirroring current delete and
move logging.
To allow for separate handling by Special:MovePage,
MovePage::isValidMove now returns a fatal status `redirectexists` if
the target isn't valid but passes Title::isSingleRevRedirect.
Otherwise, `articleexists` is returned (as previously). Other callers
that don't intend to treat single revision redirects differently
should treat `redirectexists` the same as `articleexists`.
Currently, this deletion (like normal delete and move) cannot be
done through the move api. Since the deletion is only valid when
moving a page, unlike for normal deletion, deleting redirects with
this right cannot be done via the delete api either.
Bug: T239277
Change-Id: I36c8df0a12d326ae07018046541bd00103936144
|
|
|
|
|
| |
Bug: T245701
Change-Id: I2bd3859032c12e4fb4d6fb4dc03e85f203be081a
|
|
|
|
|
|
|
|
|
|
| |
- RCDatabaseLogEntry::newFromId currently doesn't work, because the parent has
'logging' fields hardcoded. Make the failure explicit with a LogicException to
avoid sneaky failures and/or DB query errors. There's no need to
implement the missing part, given the lack of a use case.
- Same for ::getSelectQueryData
Change-Id: I748733da1a34f9af1cd431c933809c23dc37a3d6
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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: I17e5e92e24c708ffc846945a136347670a3a20c7
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 some base classes as stable for subclassing.
Bug: T247862
Change-Id: I7b77075849aa40960f2486b463e498a3ea8058e9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following glasses are marked as newable per the
Stable Interface Policy, even though logically, they should not be
newable. This is done for classes that are currently instantiated
by extensions, and lack an alternative.
A better way for obtaining an instance of these classes should be
created in the future. At that point, direct instantiation should
be deprecated and replaced.
- includes/ApiMain.php - needs factory
- includes/media/BitmapMetadataHandler.php - should become a stateless service or use handler pattern
- includes/GitInfo.php - should become a stateless service
- includes/logging/LogPage.php - should become a stateless service or use command pattern
- includes/logging/ManualLogEntry.php - should become a stateless service or use command pattern
- includes/poolcounter/PoolCounterWorkViaCallback.php - needs a factory
- includes/context/RequestContext.php - needs to be narrowed down, and should use a factory
- includes/search/SearchHighlighter.php - should have a factory
- includes/TitleArrayFromResult.php - should perhaps be part of TitleFactory
- includes/user/User.php - should at least get a factory method for anons
- includes/diff/Diff.php: needs a TextDiffGenerator service or a factory
- includes/EditPage.php: needs a factory
Bug: T247862
Change-Id: I033158e693c98630ee167d9528fc8c9936f978d4
|
|
|
|
|
|
|
|
|
| |
Per the Stable Interface Policy, PHP interfaces should not be
directly implemented by extensions, unless they are marked to be safe
for that purpose.
Bug: T247862
Change-Id: Idd5783b70fc00c03d57f5b1a887f0e47c4d7b146
|
|
|
|
|
|
|
|
| |
Remove duplicate casts
Suppress false positives
Bug: T248438
Change-Id: I2f89664a4bcd3b39b15e7cf850adda2f0c90ae6f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Remove the mention of 'return true' being legal.
This is only allowed for compat with code from before MW 1.21,
when I added hook aborting as well as tolerance for null to
be the same as true.
Since then, there is no reason to return null or return true.
For early returns, an explicitly void 'return;' should be used
instead. Returning anything else like null/true serves no purpose
other than to confuse the reader.
* Mark the interfaces as natively 'void' with return type hints.
This means in core code that runs the hook, static analysis
like Phan and in IDEs, it will be known that these onFoo()s
never return a value, thus allowing them to detect if its
return value is assigned or used in a conditional for any
reason, which can be an easy mistake.
It also means that in the future when extensions start using
these interfaces in 'implements' statement, they will be
required to mark their hooks as void.
That migration is opt-in and still up ahead. This is not
a breaking change even for all existing extensions where
a return true/null may exist in an abortable hook since this
only applies to code directly typed against the interface.
The internal run() method doesn't care.
Change-Id: Ib79289bd486ac97cec492e72f9a8dee70cf2f6c2
|
|\ |
|
| |
| |
| |
| |
| |
| | |
See I13b5fd2989f9e640718ecf5083f83017abefef25 for more information
Change-Id: I455ef14b8ee764ab5377fa72afa9c47e32a85ef7
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit b96d2808fd743efb6f0a6f2c4ed7697e3b3682f0.
This class should only be used in context of the LogFormatter and the method is not needed there.
This was added in 1.35 and the revert should be part of 1.35 to avoid deprecation process.
Change-Id: I13b5fd2989f9e640718ecf5083f83017abefef25
Depends-On: I3af1e42594f8235be815ce38e3411c762ae01092
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A terminating line break has not been required in wfDebug() since 2014,
however no migration was done. Some of these line breaks found their way
into LoggerInterface::debug() calls, where they mess up the formatting
of the debug log.
So, remove terminating line breaks from wfDebug() and
LoggerInterface::debug() calls.
Also:
* Fix the stripping of leading line breaks from the log header emitted
by Setup.php. This feature, accidentally broken in 2014, allows
requests to be distinguished in the log file.
* Avoid using the global variable $self.
* Move the logging of the client IP back to Setup.php. It was moved to
WebRequest in the hopes that it would not always be needed, however
$wgRequest->getIP() is now called unconditionally a few lines up in
Setup.php. This means that it is put in its proper place after the
"start request" message.
* Wrap the log header code in a closure so that variables like $name do
not leak into global scope.
* In Linker.php, remove a few instances of an unnecessary second
parameter to wfDebug().
Change-Id: I96651d3044a95b9d210b51cb8368edc76bebbb9e
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
… instead of basically copy-pasting this implementation detail of the
Message class. All the …Param() methods are there for a reason, so we
can depend and rely on them and don't have to guess and hope that the
Message class still accepts manually constructed arrays.
Change-Id: I96a2fda4196e960ee085123313ecb301404ac518
|
| |
| |
| |
| | |
Change-Id: If1335359b545c36fc979676c3e88d87628f9389e
|
| |
| |
| |
| | |
Change-Id: I7a5aa8555e94a0bcb97b37ec6f8ca854de7c5575
|
| |
| |
| |
| | |
Change-Id: I285af438ce484af40741489797f20455726ec110
|
| |
| |
| |
| |
| |
| | |
Mostly just narrower array types. A handful of other errors fixed.
Change-Id: Ied79d9e389867911bf83696dbb47f43305f8be7b
|
| |
| |
| |
| |
| |
| |
| |
| | |
Edited doc comments for hook interfaces to improve
consistency and add type hints.
Bug: T246855
Change-Id: I38fa802463cd6f39bf5946dbbeb1b3ebaea604b2
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add hook interfaces which were generated by a script which parses
hooks.txt and identifies caller namespaces and directories.
Hook interfaces are mostly placed in a Hook/ subdirectory
relative to the caller location. When there are callers in multiple
directories, a "primary" caller was manually selected. The exceptions to
this are:
* The source root, maintenance and tests, which use includes/Hook. Test
hooks need to be autoloadable in a non-test request so that
implementing test interfaces in a generic handler will not fail.
* resources uses includes/resourceloader/Hook
* The following third-level subdirectories had their hooks placed in
the parent ../Hook:
* includes/filerepo/file
* includes/search/searchwidgets
* includes/specials/forms
* includes/specials/helpers
* includes/specials/pagers
Parameters marked as legacy references in hooks.txt are passed
by value in the interfaces.
Bug: T240307
Change-Id: I6efe2e7dd1f0c6a3d0f4d100a4c34e41f8428720
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Updated Doxygen markup in several .php files triggering warnings when mwdocgen.php is executed. Removed
obsolete settings MSCGEN_PATH and TCL_SUBST from Doxyfile. The former would generate a warning in 1.8.16
while TCL support was removed in 1.8.18. Since TCL_SUBST was blank anyway, it was removed prior to getting
to .18 in production. Increased DOT_GRAPH_MAX_NODES from 50 to 200 since Doxygen complained about it being
too low for API and Maintenance.
Bug: T248706
Change-Id: I9c67f0807d1b43089d351263d4f591dee5501f36
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This shortens some lines below 120 characters when a tab is
counted as 4 characters (not that line lengths are currently
counted like that).
Bug: T243598
Change-Id: I828cd540268810bd56589885e38ad03f8bafc6f9
|
| |
| |
| |
| | |
Change-Id: I8d001bf97134e83998ac697bb2871833742cf087
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | | |
Bug: T246409
Change-Id: Ib7810070a870a541fa1889f3fdfa0a0a6e0f9009
|
|/ /
| |
| |
| |
| | |
Bug: T246410
Change-Id: I77d0892cd0d6dd4b85bdb7430b2ebafa2f22f5bf
|
| |
| |
| |
| |
| |
| | |
Follow up to I8990bc16
Change-Id: Id6435add2eea34ee8f79b70df152d08c3fb29ce1
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Not passing a user to the following functions is deprecated:
* Title::getNotificationTimestamp
* Revision::newNullRevision
* WikiPage::insertProtectNullRevision
* PatrolLog::record
* LogEventsList::userCan
* LogEventsList::userCanBitfield
* LogEventsList::userCanViewLogType
* LogPage::addEntry
Bug: T242935
Bug: T243652
Change-Id: I8990bc16ac72680fb65f8ca37eb7908749a9e5cc
|
| |
| |
| |
| | |
Change-Id: Iad3375b141b1d87c890baec6ecd16ed92f93e699
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The code using $wgLang is also moved inside a conditional, to avoid
unstubbing $wgLang when unnecessary.
A possible improvement is to use Skin::getLanguage() instead of $wgLang,
but that's not guaranteed to be safe, and we want to unblock the train
without introducing new issues.
Bug: T245178
Change-Id: Ifb06d9b890456092633e38b14674cc3ef48690e3
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is motivated by I1568d44, a 5 (!) year old patch.
This patch does:
* Change the visibility from protected to private. I checked. There
are no subclasses. No need to make this method available.
* Remove unused function parameters.
* Turn some conditions into guard clauses.
* Turn all these hard to read "if: big chunk of code, else: 1-liner"
around to have the 1-liner first, or just get rid of the not needed
else.
* Avoid reusing the same variable name for different things. This is
really confusing.
* Inline trivial stuff.
* Improve some "@return string" documentation to say what the string is.
* Reduce the amount of duplicate code.
Change-Id: Ied90f020057d9bdf4d979f380c3aedad5eb3ad5f
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| | |
Follows up 922be5106. These code paths are no longer reachable
given the early return for `$auto`.
Change-Id: I4f3de2e49c60326aa78234cf211e9d179505df6d
|
| |
| |
| |
| | |
Change-Id: I72290129610245fe7b8f7be0258c0efe8911c242
|
| |
| |
| |
| | |
Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
|
| |
| |
| |
| | |
Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
|
|\ \
| |/
|/| |
|