Don't pass Config object to SpecialPageFactory
authorAryeh Gregor <ayg@aryeh.name>
Tue, 9 Apr 2019 16:34:23 +0000 (19:34 +0300)
committerDaniel Kinzler <dkinzler@wikimedia.org>
Wed, 10 Apr 2019 13:45:01 +0000 (13:45 +0000)
commit37e13f0c6eb3f8bccc49a646de477c2c7bb0d0c7
tree8ba09d11c8a075fd5023934a09cde8d25481e198
parentc51e4e24ef4ce5a1ef9933fd20266e75a758027f
Don't pass Config object to SpecialPageFactory

That made SpecialPageFactory potentially dependent on every
configuration option, when it only uses a few.

In the convention I introduce here, the service class does not in
principle care that its options come from configuration variables. It
just declares a list of names of options it can receive, which happen to
match the names of configuration options, and ServiceWiring just copies
them over. In the event a service wants to receive other options that
are not configuration variables, ServiceWiring can set them
appropriately from other sources. In practice, most options will
probably come from configuration variables, so using the same names and
passing them directly makes the code shorter and easier to understand.

Change-Id: I3e57513826dc5130f468486470f29eeee659d697
includes/ServiceWiring.php
includes/specialpage/SpecialPageFactory.php