本文整理匯總了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}");
}