Page MenuHomePhabricator

Convert PageProps to a service with dependency injection
Closed, ResolvedPublic

Description

I propose converting PageProps to a service. Within the class, it uses:

  • wfGetDB (to be replaced with ILoadBalancer)
  • new LinkBatch (to be replaced with LinkBatchFactory)

Converting it to a service would also allow it to be tested with Unit tests

Currently, the constructor is private, and an instance is retrieved with PageProps::getInstance(). This means that breaking changes can be made to the construct when making it public, and dependencies can be injected without the need to support construction without the parameters

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 597666 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Convert PageProps to a service

https://gerrit.wikimedia.org/r/597666

Change 597666 merged by jenkins-bot:
[mediawiki/core@master] Convert PageProps to a service

https://gerrit.wikimedia.org/r/597666