本文整理汇总了PHP中Wikia::parseMessageToArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Wikia::parseMessageToArray方法的具体用法?PHP Wikia::parseMessageToArray怎么用?PHP Wikia::parseMessageToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wikia
的用法示例。
在下文中一共展示了Wikia::parseMessageToArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addExtraWords
/**
* Add words from:
* * $wgSpellCheckerExtraWordsGlobal
* * $wgSpellCheckerExtraWords(langcode)
* * MediaWiki:Dictionary message
* to current dictionary (for this session only)
*/
private function addExtraWords()
{
wfProfileIn(__METHOD__);
$words = array();
// add "global" extra words
$words = array_merge($words, (array) $this->app->getGlobal('wgSpellCheckerExtraWordsGlobal'));
// add "per language" extra words
$variableName = 'wgSpellCheckerExtraWords' . ucfirst($this->lang);
$words = array_merge($words, (array) $this->app->getGlobal($variableName));
// add "per wiki: extra words (from MediaWiki:Dictionary)
$localDictionary = Wikia::parseMessageToArray('dictionary', true);
$words = array_merge($words, $localDictionary);
// remove duplicated words
$words = array_unique($words);
//var_dump($words);
if (!empty($words)) {
foreach ($words as $word) {
$this->dict->addWord($word);
}
$wordsCount = count($words);
wfDebug(__METHOD__ . ": {$wordsCount} extra words added to the dictionary\n");
}
wfProfileOut(__METHOD__);
}