Commit graph

27 commits

Author SHA1 Message Date
Fomafix 9206c5368b Inject service DBLoadBalancerFactory
Change-Id: I50195f98c2ea130f9dba73e357977653c2fc1a37
2023-11-14 13:40:30 -05:00
Fomafix c63d5da014 Replace global variables by injected Config
Convert some functions to non-static function to access the Config
object.

Change-Id: Iac3d6a6c00eef169aec91b8c367cbbb7359a9b02
2023-11-14 07:15:35 +00:00
Fomafix e492044e44 Inject service LinkRenderer into CategoryTree
Change-Id: Id70e9b26229332889de009b55837dbab6ecbb163
2023-10-29 09:28:03 +00:00
Fomafix e81f6fe15e Move option handling from CategorieTree into new class OptionManager
Change-Id: I0327f7ea6751cdb714308f1ffaf0ab7ac44a3aac
2023-10-29 09:26:56 +00:00
Fomafix 8bd82c12f6 Use namespaced classes
Change-Id: I9fabf791aae691dfa7d071a1d99d17f4f7379682
2023-10-03 09:36:31 +00:00
Fomafix b2ef67d9c8 Replace deprecated wfGetDB( DB_REPLICA )
Bug: T330641
Change-Id: Ic2dc694bbb29c3ff315f2be32c24ee6995f9b964
2023-09-20 20:42:06 +00:00
gerritbot 6d296c41ce Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I004e02c6b719be1bbfa1fa19f53e4fab2a7aeca1
2023-08-16 01:54:29 +00:00
Umherirrender 3252ddc115 Simplify ApiCategoryTree::extractOptions
Change-Id: I98605b2580a995e37a8da1b88693b38bbd5b8013
2023-04-25 20:06:08 +02:00
Ammarpad 277b547d21 ApiCategoryTree: Harden validation of JSON values in options parameter
* All option values are not expected be object themselves.
* Allow 'namespace' option to take scalar or array value.
* All other options take scalar values only.

Bug: T335145
Change-Id: I3bdb284f26d0c9ee8230f2197b168a7e83c145c3
2023-04-24 23:59:33 +01:00
gerritbot a42526cc2e Fix usage of ApiBase::PARAM_* deprecated constants
The ones that are replaced with ParamValidator

Bug: T275455
Change-Id: Ib1ad9e3837bb5030918e84c12c63f570bc67bd3b
2022-04-04 01:24:23 +02:00
Fomafix 4a3f1aadc5 ApiCategoryTree: Inject services
Change-Id: Id22dbb344307322247c75cde6cf56cccdf012203
2021-11-02 20:13:55 +00:00
libraryupgrader 0c23e8e620
build: Updating composer dependencies
* mediawiki/mediawiki-phan-config: 0.10.6 → 0.11.0
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

Change-Id: I9d26e128cc02d1057b639547e396235e4c3a5a3a
2021-09-08 21:18:55 +03:00
libraryupgrader e2ee5bff3c build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Change-Id: I6daf5f05db0a1db2c3089dc1be047b752d52c4ec
2021-05-04 01:18:21 +00:00
Reedy 03685efdba Namespace extension
Change-Id: Idf4fbb9ff0c11b9da0b48b3843b2c87c155a4c36
2021-04-08 01:28:21 +01:00
Daimona Eaytoy 7acc45f672 Stop using deprecated Language methods
Change-Id: Ibcb9cf30dd6e7a496a6cbe6ceab871a4405e0642
2021-02-27 13:59:57 +00:00
Aaron Schulz f7233850e4 Convert $wgMemc use to WANObjectCache
Bug: T160813
Change-Id: Icacecf5ecc4260385a95b99f5a491a58175c14de
2020-03-30 14:11:50 -07:00
libraryupgrader cdb24f697e build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Additional changes:
* Added .eslintcache to .gitignore.

Change-Id: I74187354a1cbb7703e446752d7ab4500e993e3e8
2019-12-27 15:08:47 +00:00
Derick Alangi 5b342c51ab Avoid usage of deprecated $wgContLang global (dep in 1.32)
Change-Id: Ic70ac2bc7eeba6af9a69bb1eb839a87cd06c01f8
2019-09-01 19:01:45 +00:00
Derick Alangi 0bebd426d8 ApiCategoryTree: Replace use of deprecated methods
Deprecated methods that have been replaced are;

* ConfigFactory::getDefaultInstance()
* wfMemcKey()

This extension uses 1.33 of core and these replacements
are safe.

Change-Id: I1536ab2adecc79fd42b46e2c892dae4a536c9496
2019-05-16 20:49:39 +01:00
Max Semenik 60884c60e7 Stop manually messing with caching HTTP headers
It has origins in times when this code was in an AJAX function, however
now that it's in an API module it's not needed and can be counter-productive
as headers issued might conflict with MW headers. Let the API take care of
this via its standard means.

Change-Id: I8ebf8e7b935d7d252ac010bc1b88202b87f43e20
2019-03-05 20:55:22 +00:00
Fomafix c993bb8353 Fix findings by phpcs
* Add @inheritDoc to functions that are inheritance.
* Move comments to a single line.

Remove the phpcs rule exceptions:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: I742ee19f0a3d2d62e08b6f2e35cd9a6b3940cd22
2019-02-06 18:03:50 +00:00
Fomafix b3ac7f5404 Add typehints to function parameters
* Add "= null" when null is supported and used.
* Also fix Doxygen tags.

Change-Id: I209b23eee54b5e8e0f4091f3d4cd7c5e44dbaff0
2019-02-05 15:30:31 +01:00
James D. Forrester 96b44610ac API: Drop back-compat. code for old versions of MW we don't support
Change-Id: I1eb8f75399a6cd10a685ede98673cc6122494980
2018-10-26 18:02:44 +00:00
Umherirrender 1d47aeba0b Add api error 'invalidtitle' for invalid category param
When giving an invalid title, for example containing double encoded %
(%2527 from the task), the code would raise a BadMethodCallException on
the null title.

It is better to get an api error, when invalid title is given, because
that is more informativ for the client than a php fatal

Bug: T202057
Change-Id: I7af2a8d072216eca8d3241b2c082089a78fbf621
2018-08-18 15:30:43 +00:00
Kunal Mehta 50c10d1fcb Use standard GPL file header
Change-Id: Ic49d45d0a0cb640d40486735c95f13cc6e29063f
2018-04-16 22:38:06 +00:00
Kunal Mehta 4e1158b7d2 Add phan configuration
Change-Id: I8d438ad061500bc56f5e3e527f18296485988d6f
2018-04-08 18:50:31 -07:00
Kunal Mehta 8e51ea4e3a Move classes into includes/
Change-Id: I308523aa764594798d72974fb79e19aef6c3f342
2018-02-08 22:23:07 -08:00
Renamed from ApiCategoryTree.php (Browse further)