本文整理汇总了PHP中TranslateUtils::getTokenAction方法的典型用法代码示例。如果您正苦于以下问题:PHP TranslateUtils::getTokenAction方法的具体用法?PHP TranslateUtils::getTokenAction怎么用?PHP TranslateUtils::getTokenAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TranslateUtils
的用法示例。
在下文中一共展示了TranslateUtils::getTokenAction方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testTokenRetrieval
/** @dataProvider provideTokenClasses */
public function testTokenRetrieval($id, $class)
{
// Make sure we have the right to get the token
global $wgGroupPermissions;
$wgGroupPermissions['*'][$class::getRight()] = true;
RequestContext::getMain()->getUser()->clearInstanceCache();
// Reread above global
// We should be getting anonymous user token
$expected = $class::getToken();
$this->assertNotSame(false, $expected, 'We did not get a valid token');
$actionString = TranslateUtils::getTokenAction($id);
$params = wfCgiToArray($actionString);
$req = new FauxRequest($params);
$api = new ApiMain($req);
$api->execute();
if (defined('ApiResult::META_CONTENT')) {
$data = $api->getResult()->getResultData(null, array('Strip' => 'all'));
} else {
$data = $api->getResultData();
}
if (isset($data['query'])) {
foreach ($data['query']['pages'] as $page) {
$this->assertSame($expected, $page[$id . 'token']);
}
} else {
$this->assertArrayHasKey('tokens', $data, 'Result has tokens');
$this->assertSame($expected, $data['tokens'][$id . 'token']);
}
}
示例2: getParamDescription
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription()
{
$action = TranslateUtils::getTokenAction('translationstash');
return array('subaction' => 'Action', 'title' => 'Title of the translation unit page', 'translation' => 'Translation made by the user', 'metadata' => 'Json object', 'token' => "A token previously acquired with {$action}", 'username' => 'Optionally the user whose stash to get. ' . 'Only privileged users can do this');
}
示例3: getParamDescription
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription()
{
$action = TranslateUtils::getTokenAction('aggregategroups');
return array('do' => 'What to do with aggregate message group', 'group' => 'Message group id', 'aggregategroup' => 'Aggregate message group id', 'groupname' => 'Aggregate message group name', 'groupdescription' => 'Aggregate message group description', 'token' => "A token previously acquired with {$action}");
}
示例4: getParamDescription
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription()
{
$action = TranslateUtils::getTokenAction('translationreview');
return array('revision' => 'The revision number to review', 'token' => "A token previously acquired with {$action}");
}
示例5: getParamDescription
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription()
{
$action = TranslateUtils::getTokenAction('groupreview');
return array('group' => 'Message group', 'language' => 'Language code', 'state' => 'The new state for the group', 'token' => "A token previously acquired with {$action}");
}