<commit_before><?php
class Pleesher_ViewHelper
{
	public function pageUrl($page_name, $absolute = false)
	{
		$title = Title::newFromText($page_name);

		return $absolute ? $title->getFullURL() : $title->getLocalURL();
	}

	public function text($key, array $params = [])
	{
		return wfMessage($key)->params($params)->inContentLanguage()->escaped();
	}
}<commit_msg>Added actionUrl which returns an URL to an api.php action (with optional parameters)<commit_after><?php
class Pleesher_ViewHelper
{
	public function pageUrl($page_name, $absolute = false)
	{
		$title = Title::newFromText($page_name);

		return $absolute ? $title->getFullURL() : $title->getLocalURL();
	}

	public function actionUrl($name, array $params = [])
	{
		return $GLOBALS['wgScriptPath'] . '/api.php?' . http_build_query(array_merge(['action' => $name], $params));
	}

	public function text($key, array $params = [])
	{
		return wfMessage($key)->params($params)->inContentLanguage()->escaped();
	}
}
{'fraction_non_alphanumeric': 0.17163412127440905, 'fraction_numerical': 0.0, 'mean_word_length': 5.763888888888889, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1622872', 'n_tokens_mistral': 329, 'n_tokens_neox': 313, 'n_words': 65}