Commit graph

476 commits

Author SHA1 Message Date
James D. Forrester
4f2d1efdda Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse
Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
2020-01-10 09:32:25 -08:00
apaskulin
4d24ad65c9 docs: Remove ingroup tag from Markdown files
This patch fixes the nesting issue in the Doxygen navigation
by removing the @ingroup tag from class-level Markdown files.
These files will now appear as top-level files in the
navigation and are discoverable via links on the class pages.

Bug: T87796
Change-Id: I370bfea3bf2a6816724d04b15107658f1c336f0f
2019-11-12 16:11:30 -08:00
Umherirrender
337ecb0514 Add missing @param and @return to documentation
Change-Id: Ibc5849cc8ea7e7c4eb30ded9c1cfa5f52187c377
2019-11-10 22:12:58 +00:00
Aryeh Gregor
84cf385db0 Deprecate FileJournal::factory
Instead, the constructors for FileJournal and NullFileJournal should be
treated as stable. I would have added @stable, but our linting doesn't
recognize it yet and doesn't let.

Bug: T235066
Change-Id: I7741055b4f00197d1346ebbfebc14f20238a06f3
2019-11-04 15:17:56 +01:00
jenkins-bot
605bf24772 Merge "docs: Convert class-level documentation files to Markdown" 2019-11-01 01:43:29 +00:00
apaskulin
80221c0aff docs: Convert class-level documentation files to Markdown
The FileRepo, FileBackend, and JobQueue classes include documentation
files that don’t appear in the generated Doxygen docs. This PR:

* Converts these files to Markdown
* Links to each file from the respective class description
* Adds an ingroup tag so the files appear in the sidebar at the
  module level
* Updates the exclude pattern in the Doxyfile to surface these pages

Bug: T87796
Change-Id: I94f0636ab489d741ab505f15da43a5d63c1ca61a
2019-10-31 11:03:13 -07:00
jenkins-bot
a1cc2a6e12 Merge "Hard-deprecate LockManagerGroup::getDefault/getAny" 2019-10-30 12:02:39 +00:00
Aryeh Gregor
b0795a2550 Hard-deprecate LockManagerGroup::getDefault/getAny
These appear to be unused. Moreover, their behavior doesn't match their
documentation. getDefault() claims to return NullLockManager if no lock
manager could be found, but really returns it if there's no lock manager
named 'default'. getAny() claims to throw if no lock manager can be
found, but actually throws if no lock manager is named 'default' or
'fsLockManager'. The behavior can be easily replicated by just using
get() yourself and catching any exception.

Bug: T234227
Change-Id: Iad083847f45d6e017a3f7dbfece1f9c155c5efd6
2019-10-29 14:48:44 +02:00
Aryeh Gregor
0d3d6be18d Convert FileBackendGroup to service
Bug: T234228
Change-Id: I25575f565eba122cdf971a5945572811d17fa3e1
2019-10-25 10:46:20 +03:00
Daimona Eaytoy
95dc119527 Fix new phan errors, part 2
Still mostly doc-only.

Bug: T231636
Change-Id: I65cec6c716ce6859e14da00a12ef71e03603e59a
2019-10-12 10:35:09 +00:00
Aaron Schulz
a775c6888b filebackend: avoid use of wfWikiId() in FileBackendGroup
Also warn when there is a risk of automatic backend domain collisions

Change-Id: Id488b5b947ef5fe8f4b0a8e96560bfd44fcc0327
2019-09-24 18:52:44 -07:00
Aryeh Gregor
5bbcaef231 FileJournal tests
100% unit test coverage for FileJournal and NullFileJournal. 100%
integration test coverage for DBFileJournal. Unit tests for
DBFileJournal once it supports injection.

I removed FileJournal and NullFileJournal from the list of classes that
FileBackendTest tests. It doesn't actually test them, it just happens to
run code from them without checking its correctness at all.

Depends-On: Ic22075bb5e81b7c2c4c1b8647547aa55306a10a7
Change-Id: I46d10ab7b87c23937aa04d7ec1922abfcf3bd611
2019-09-03 10:12:41 +00:00
jenkins-bot
694ca68b23 Merge "Integration tests for FileBackendGroup" 2019-08-28 17:09:44 +00:00
Aryeh Gregor
bd2a439502 Integration tests for FileBackendGroup
100% coverage except for one bit of the code that I didn't understand.
Unit tests to come, together with rewrite as a service.

Change-Id: Ib01758d994a9e5587a4fcb5edc3d80010ef05615
2019-08-28 11:21:44 +03:00
Aryeh Gregor
37022e2e89 LockManagerGroup tweaks
One small change that was supposed to be in 5a6c18a086 but didn't make
it into the patch version that got merged, and removal of some long-dead
code.

phan objected to the use of new $class without being explicitly
reassured that $class is, in fact, a string. I don't know why.

Change-Id: Ifa00c59ab4464109414f21db37e3a6db21decdf3
2019-08-28 10:49:37 +03:00
Aryeh Gregor
5a6c18a086 LockManagerGroupFactory to replace singletons
100% test coverage of code that appears to be working and used, in both
LockManagerGroupFactory and also LockManagerGroup. Where possible I
wrote it as unit tests. One preexisting code path seems to be broken and
I marked the test as skipped. Two methods look unused and perhaps not
especially helpful, so I didn't write tests for them yet in case we want
to just get rid of them instead.

Change-Id: Iaa7354f31c451b87773468609c674a3bf1d4382f
2019-08-27 13:19:15 +03:00
Fomafix
bb94f4964d Use local variabe $services instead of MediaWikiServices::getInstance()
Change-Id: Ieb6230231d9b916fd1366e7b473db00c87ac4428
2019-08-26 16:12:05 +02:00
Aryeh Gregor
a83b33582a TempFSFileFactory service
This replaces TempFSFile::factory(), which is now deprecated.

Change-Id: I9e65c3867e26c16687560dccc7d9f3e195a8bdd6
2019-08-21 16:26:05 +03:00
Aaron Schulz
69f50aacea Code style cleanups to FileBackendGroup
Set domainId in register() instead of on every config() call.
Use array_merge() to make the override precedence clearer.

Change-Id: I8792281cd9f1a4018255f9a9b87126c909095e68
2019-08-01 20:04:53 +00:00
Aaron Schulz
c2d96ef394 filebackend: avoid use of LoadBalancer::newMainLB() in LockManagerGroup
Change-Id: Iffe9f75ddc9cdbea8a4b5e1932dd55ae325f9dbc
2019-07-16 06:31:15 +00:00
Kunal Mehta
4ef179e335 Fix/suppress misc phan errors (#5)
Add lots of missing return statements, or remove incorrect doc blocks.

Change-Id: I0881e98fbb9d0d4cf79ecc824064d24538055d3f
2019-04-05 15:53:37 -07:00
Aaron Schulz
d0dde42439 Avoid use of deprecated "wikiId" parameter for FileBackend
Also cleaned up the parameter/field naming for DBFileJournal

Change-Id: I70f2a870706f0813311a694cb8ea31ced58dcabb
2019-03-29 15:24:09 -07:00
Aaron Schulz
c25d8111be filebackend: change "profiler" parameter in FileBackend so it works again
The Profiler::profileIn and Profiler::profileOut methods are just stubs.
Use a callback to the Profile::scopedProfileIn method instead.

Change-Id: I7b493c145357994f61faebfbe3f65d38d2e6da42
2019-03-14 23:03:09 +00:00
Aaron Schulz
5196ac32c6 Rename WikiMap DB domain ID methods to reduce confusion with web domains
Those added in this same release do not need alias methods.

Change-Id: I05feeb9b0b13afe43aea1f95551965489cdbe094
2019-02-06 12:28:45 -08:00
Aaron Schulz
dcd0a3d534 Add isCurrentWikiId()/isCurrentWikiDomain()/getCurrentWikiDomain() to WikiMap
Use these in place of various wfWikiID() calls.

Also cleanup UserRightsProxy wiki ID variable names and removed unused
and poorly named getDBname() method.

Change-Id: Ib28889663989382d845511f8d34712b08317f60e
2018-10-29 14:53:37 -07:00
Aaron Schulz
e4558d4885 filebackend: let any specific backend value of "readOnly" override the default
Previously, only different reason strings could override, but there was
no way to override the read-only mode to being off.

Change-Id: I4266694034bfbdada90d4be96bcbc1a37f5b5409
2018-07-19 17:11:39 +01:00
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
Thiemo Kreuz
645d96b0e1 Fix and improve PHPDoc type hints in FileBackend and FileRepo
Change-Id: I311b4a6777946b451d70c6fdb2133dbbd73f159f
2018-04-19 10:32:09 +02:00
Umherirrender
3124a990a2 Use ::class to resolve class names in includes files
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: I07a925c2a9404b0865e8a8703864ded9d14aa769
2018-01-27 20:34:29 +01:00
Thiemo Mättig
409da2d8b3 Remove leading backslashes from "use \…" tags
Change-Id: I494b029de089a07e3b946ee78293a12d5036f63e
2017-12-28 16:30:05 +01:00
Reedy
c16af68fb6 Replace MimeMagic::singleton() calls
Change-Id: Ieed41b5d6b0f568fe2872e7754f2feae7868fe7a
2017-11-27 02:13:51 +00:00
WMDE-Fisch
6df9ed1ad6 update mediawiki-codesniffer to 0.11.0 and fix issues
- mostly auto fixes
- some too long lines fixed
- ignore amp space in one case  passing by reference

Change-Id: I6472f83bc3cbf4bd629d83050cc3319b19ec465c
2017-08-11 22:27:51 +02:00
Aaron Schulz
82e2c924e4 Remove "@author Aaron Schulz" annotations
Bug: T139301
Change-Id: Ib5248e8e27d60611c7373bce4b29dd5e85aa3489
2017-06-27 15:24:14 -07:00
Aaron Schulz
dd359741cc Move DB errors to Rdbms namespace
Change-Id: I463bd86123501abc68fdb78b4cda6110f7af2549
2017-04-15 10:47:41 -07:00
Aaron Schulz
488a647831 Move IDatabase/IMaintainableDatabase to Rdbms namespace
Change-Id: If7e8a8ff574661fd827de8bcec11d2c39a687300
2017-03-28 15:32:38 -07:00
WMDE-Fisch
ae3419f532 Replace some of the deprecated wfGetLBFactory() calls
Change-Id: I87aa0ebe273706438f1634167de8c60f51432878
2017-02-07 14:41:09 +01:00
Fomafix
202f695f67 Update weblinks in comments from HTTP to HTTPS
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.

Also update some defect links.

Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
2016-11-07 15:24:46 +01:00
Aaron Schulz
88aa91f84a Clean up some ObjectCache factory callers
* Use services container in more places.
* Undeprecated getLocalServerInstance() since $fallback is not
  handled elsewhere.

Change-Id: Id1fcd1c465d2d92653357523f4225f1c4d1ace2f
2016-10-03 11:44:55 -07:00
Aaron Schulz
a2dd3480da Cleanup MemcLockManager and move it to /libs
* Remove wf* function and ObjectCache dependencies.
* Use the base class session field.
* Lower physical lock structure TTL and move it to the base
  class as a constant.
* Resolve TODO about acquiring mixed lock types in one pass.
* Only mark servers down for 30 seconds in case of long-running
  scripts.

Change-Id: Icd4be407e599524cc620975d27e85666d2532b95
2016-09-30 06:33:32 -07:00
Aaron Schulz
99339b4598 Make multi-write backend "template" config work as expected
* FileBackendGroup now applies the usual config for these sub-backends,
  the same config get() applies.
* Also make sure FileBackendMultiWrite::concatenate() uses the status wrapper.

Bug: T146904
Change-Id: I1e9b5027dbac11ea9484cd16851e5db998574429
2016-09-29 13:20:06 -07:00
Aaron Schulz
51f00e3db8 Move SwiftFileBackend to /libs
Change-Id: Ied0be9891d70930caf415d75cb3b89043347f47e
2016-09-24 15:03:56 -07:00
Aaron Schulz
dc522cf0a3 Depedencency cleanups to SwiftFileBackend
* Avoid wf* function MediaWiki dependencies.
* Don't bother with getLocalClusterInstance() caching for the CLI case.
* Give FileBackend a default 'resetOutputBuffer' callback.

Change-Id: I359da1ad77c62880ea799b65cd3a16ad673a64eb
2016-09-24 02:15:32 +00:00
Aaron Schulz
1bf0390fbd Move FSFilebackend and MemoryFileBackend to /libs
Change-Id: Id38a2ef9e0e22537d0267b536f8a4dfd60c5b41d
2016-09-24 00:10:27 +00:00
Aaron Schulz
fee33df849 Remove wf* function usage from FSFileBackend
Change-Id: Iad6471724f8cdc596c755e6194da7556158e9203
2016-09-23 23:10:42 +00:00
jenkins-bot
c9cf1b2763 Merge "Move FileBackendStore and FileOp classes to /libs" 2016-09-23 22:52:46 +00:00
jenkins-bot
305499a998 Merge "Move RedisLockManager to /libs" 2016-09-23 22:09:31 +00:00
jenkins-bot
5680b24b3e Merge "Move RedisConnectionPool to /libs/redis" 2016-09-23 21:57:36 +00:00
Aaron Schulz
6e5329cd8e Move FileBackendStore and FileOp classes to /libs
Change-Id: If490f64bec282e5dfcdaf7feb1cbf46d3dce1064
2016-09-23 14:46:53 -07:00
Aaron Schulz
c796715911 Remove wfDebugLog() dependency from FileOp classes
Change-Id: Ib8ab9edd1afdb28f7444f5e13cf34a696a066234
2016-09-23 21:30:08 +00:00
jenkins-bot
5c529ac835 Merge "Add HTTPFileStreamer class" 2016-09-23 21:28:52 +00:00