"Brion VIBBER" changed the status of MediaWiki.r107927 to "fixme" and commented 
it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/107927#c28870

Old Status: new
> New Status: fixme

Commit summary for MediaWiki.r107927:

Give Title a decent loading mechanism:
* Added Title::load() to factorise common code that load member variables 
instead of having each accessor doing it own loading system for its related 
member variable
* Removed usage of LinkCache::addLinkObj() to do the database query and do this 
directly in Title::load(). This allows to select the complete database row and 
populate all member variables; previously, requesting a field not stored in 
LinkCache (using getCount(), getTouched() or isNewPage()) results in two 
database query, one to load LinkCache data and the second to load the requested 
field; now there'll be only one query.
* Added Title::FIELD_IN_LINKCACHE and Title::FIELD_NOT_IN_LINKCACHE to specify 
whether the requested field is stored in LinkCache or not. LinkCache will be 
used if possible (i.e. Title::FIELD_IN_LINKCACHE is passed), otherwise a DB 
query to select the complete row is issued.
* Made Title::loadFromRow() save the row to LinkCache if possible.
* Added $wasFromMaster parameter to Title::loadFromRow() to tell that method 
whether the row was loaded from the master database or not and pass it from 
WikiPage::loadPageData()
* Added Title::GAID_USE_MASTER in addition to Title::GAID_FOR_UPDATE to get the 
row from the master database without having to do a SELECT FROM UPDATE query
* Added Title::selectFields() method to return the fields to select to given 
Title::loadFromRow() (and methods using it such as Title::newFromRow()) a 
complete row
* Made Title::$mCounter private since it has only been added recently (in 
r105790)
* Mark the object as loaded if Title::resetArticleID() is called with as new ID 
as 0

Brion VIBBER's comment:

Title should have fewer, not more internal state variables. Strongly recommend 
against this. Really don't need to be doing a refactor like this at the end of 
a version cycle, with no tests.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to