User "Platonides" changed the status of MediaWiki.r86775. Old Status: new New Status: fixme
User "Platonides" also posted a comment on MediaWiki.r86775. Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/86775#c16357 Commit summary: Stop stubbing $wgLang and $wgContLang. There are no major code paths which do not call either $wgLang or $wgContLang at least once. All index.php calls unstub $wgContLang from MediaWiki::parseTitle() except in the edgecase of viewing pages referenced only by "curid=123", and since those will end up calling OutputPage::output() they will eventually be unstubbed at some point as well. All calls through load.php unstub $wgLang in ResourceLoaderContext::getLanguage() from ResouceLoader::respond() --> ResourceLoader::preloadModuleInfo(). All calls through api.php unstub $wgContLang in ApiResult::cleanUpUTF8() from ApiMain::printResult(). Comment: Breaks databaseless phpunit tests. The Language::factory() at Setup.php(400) tries to load the localization from the db. With the StubContLang, phpunit was able to disable Database messages before the unstubbing. <pre> Stack trace: #0 phase3/includes/db/Database.php(518): DatabaseMysql->open('10.0.6.47', 'wikiuser', 'jgmeidj28gms', 'eswiki') #1 phase3/includes/db/Database.php(566): DatabaseBase->__construct('10.0.6.47', 'wikiuser', 'jgmeidj28gms', 'eswiki', 16, 'get from global') #2 phase3/includes/db/LoadBalancer.php(658): DatabaseBase::newFromType('mysql', Array) #3 phase3/includes/db/LoadBalancer.php(539): LoadBalancer->reallyOpenConnection(Array, false) #4 phase3/includes/db/LoadBalancer.php(460): LoadBalancer->openConnection(0, false) #5 phase3/includes/GlobalFunctions.php(3128): LoadBalancer->getConnection(-1, Array, false) #6 phase3/includes/LocalisationCache.php(768): wfGetDB(-1) #7 phase3/includes/LocalisationCache.php(318): LCStore_DB->get('es', 'deps') #8 phase3/includes/LocalisationCache.php(353): LocalisationCache->isExpired('es') #9 phase3/includes/LocalisationCache.php(259): LocalisationCache->initLanguage('es') #10 phase3/includes/LocalisationCache.php(205): LocalisationCache->loadItem('es', 'fallback') #11 phase3/languages/Language.php(2968): LocalisationCache->getItem('es', 'fallback') #12 phase3/languages/Language.php(197): Language::getFallbackFor('es') #13 phase3/languages/Language.php(148): Language::newFromCode('es') #14 phase3/includes/Setup.php(400): Language::factory('es') #15 phase3/maintenance/doMaintenance.php(108): require_once('.../Setup.php') #16 phase3/tests/phpunit/phpunit.php(38): require('.../doMaintenance.php') #17 {main} </pre> _______________________________________________ MediaWiki-CodeReview mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview
