当前位置: 首页>>代码示例>>PHP>>正文


PHP TranslateUtils::getTokenAction方法代码示例

本文整理汇总了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']);
     }
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:30,代码来源:ApiTokensTest.php

示例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');
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:8,代码来源:ApiTranslationStash.php

示例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}");
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:8,代码来源:ApiAggregateGroups.php

示例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}");
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:8,代码来源:ApiTranslationReview.php

示例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}");
 }
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:8,代码来源:ApiGroupReview.php


注:本文中的TranslateUtils::getTokenAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。