Introducing TitleValue
authordaniel <daniel.kinzler@wikimedia.de>
Thu, 9 Jan 2014 14:35:16 +0000 (15:35 +0100)
committerOri.livneh <ori@wikimedia.org>
Fri, 28 Mar 2014 18:42:17 +0000 (18:42 +0000)
commit154bcdc63f300a628a9cbe8dc7955f96862c56ab
tree695e01eb311c901f53d89d9da596497ed1775bb5
parentcb79917e435f1dee616bc71d974785da8fc4b26a
Introducing TitleValue

TitleValue is intended to be a light weight alternative to the Title
class. Any operations on TitleValue are implemented in separate
service classes, like TitleFormatter and PageLinkRenderer. See
<https://www.mediawiki.org/wiki/Requests_for_comment/TitleValue>
for more information.

This change updates SpecialCategories and SpecialLinkSearch to use
TitleValue instead of Title, to demonstrate how TitleValue would be
used, and how the necessary services can be injected and applied.

The intention is to improve testability and reusability; these
advantages will however only become apparent with further refactoring
of the respective special pages. This will be done in follow-up
changes.

More work will be needed to migrate essential functionality from
Title and Linker classes into the respective service classes,
MediaWikiTitleCodec and MediaWikiPageLinkRenderer.

Change-Id: I8eef5a165de4ffcacfbc4911fdacdb15d502fff4
16 files changed:
includes/AutoLoader.php
includes/Linker.php
includes/Title.php
includes/specials/SpecialCategories.php
includes/specials/SpecialLinkSearch.php
includes/title/MalformedTitleException.php [new file with mode: 0644]
includes/title/MediaWikiPageLinkRenderer.php [new file with mode: 0644]
includes/title/MediaWikiTitleCodec.php [new file with mode: 0644]
includes/title/PageLinkRenderer.php [new file with mode: 0644]
includes/title/TitleFormatter.php [new file with mode: 0644]
includes/title/TitleParser.php [new file with mode: 0644]
includes/title/TitleValue.php [new file with mode: 0644]
tests/phpunit/includes/TitleTest.php
tests/phpunit/includes/title/MediaWikiPageLinkRendererTest.php [new file with mode: 0644]
tests/phpunit/includes/title/MediaWikiTitleCodecTest.php [new file with mode: 0644]
tests/phpunit/includes/title/TitleValueTest.php [new file with mode: 0644]