Merge "API edit: allow ConfirmEdit to use the merged parse"
[lhc/web/wiklou.git] / includes / api / ApiTokens.php
index 8e2ecfb..2a60af9 100644 (file)
  */
 
 /**
+ * @deprecated since 1.24
  * @ingroup API
  */
 class ApiTokens extends ApiBase {
 
        public function execute() {
+               $this->setWarning(
+                       "action=tokens has been deprecated. Please use action=query&meta=tokens instead."
+               );
+               $this->logFeatureUsage( "action=tokens" );
+
                $params = $this->extractRequestParams();
                $res = array();
 
@@ -71,6 +77,10 @@ class ApiTokens extends ApiBase {
                return $types;
        }
 
+       public function isDeprecated() {
+               return true;
+       }
+
        public function getAllowedParams() {
                return array(
                        'type' => array(
@@ -81,20 +91,12 @@ class ApiTokens extends ApiBase {
                );
        }
 
-       public function getParamDescription() {
-               return array(
-                       'type' => 'Type of token(s) to request'
-               );
-       }
-
-       public function getDescription() {
-               return 'Gets tokens for data-modifying actions.';
-       }
-
-       protected function getExamples() {
+       protected function getExamplesMessages() {
                return array(
-                       'api.php?action=tokens' => 'Retrieve an edit token (the default)',
-                       'api.php?action=tokens&type=email|move' => 'Retrieve an email token and a move token'
+                       'action=tokens'
+                               => 'apihelp-tokens-example-edit',
+                       'action=tokens&type=email|move'
+                               => 'apihelp-tokens-example-emailmove',
                );
        }
 }