Merge "Schema is not PostgreSQL connection parameter"
[lhc/web/wiklou.git] / includes / api / ApiExpandTemplates.php
index 8a3b534..eea10e9 100644 (file)
@@ -75,7 +75,7 @@ class ApiExpandTemplates extends ApiBase {
                                $this->logFeatureUsage( 'action=expandtemplates&generatexml' );
                        }
 
-                       $wgParser->startExternalParse( $title_obj, $options, OT_PREPROCESS );
+                       $wgParser->startExternalParse( $title_obj, $options, Parser::OT_PREPROCESS );
                        $dom = $wgParser->preprocessToDom( $params['text'] );
                        if ( is_callable( array( $dom, 'saveXML' ) ) ) {
                                $xml = $dom->saveXML();
@@ -96,7 +96,7 @@ class ApiExpandTemplates extends ApiBase {
                // if they didn't want any output except (probably) the parse tree,
                // then don't bother actually fully expanding it
                if ( $prop || $params['prop'] === null ) {
-                       $wgParser->startExternalParse( $title_obj, $options, OT_PREPROCESS );
+                       $wgParser->startExternalParse( $title_obj, $options, Parser::OT_PREPROCESS );
                        $frame = $wgParser->getPreprocessor()->newFrame();
                        $wikitext = $wgParser->preprocess( $params['text'], $title_obj, $options, null, $frame );
                        if ( $params['prop'] === null ) {
@@ -159,35 +159,10 @@ class ApiExpandTemplates extends ApiBase {
                );
        }
 
-       public function getParamDescription() {
+       protected function getExamplesMessages() {
                return array(
-                       'text' => 'Wikitext to convert',
-                       'title' => 'Title of page',
-                       'prop' => array(
-                               'Which pieces of information to get',
-                               ' wikitext   - The expanded wikitext',
-                               ' categories - Any categories present in the input that are not represented in ' .
-                                       'the wikitext output',
-                               ' volatile   - Whether the output is volatile and should not be reused ' .
-                                       'elsewhere within the page',
-                               ' ttl        - The maximum time after which caches of the result should be ' .
-                                       'invalidated',
-                               ' parsetree  - The XML parse tree of the input',
-                               'Note that if no values are selected, the result will contain the wikitext,',
-                               'but the output will be in a deprecated format.',
-                       ),
-                       'includecomments' => 'Whether to include HTML comments in the output',
-                       'generatexml' => 'Generate XML parse tree (replaced by prop=parsetree)',
-               );
-       }
-
-       public function getDescription() {
-               return 'Expands all templates in wikitext.';
-       }
-
-       public function getExamples() {
-               return array(
-                       'api.php?action=expandtemplates&text={{Project:Sandbox}}'
+                       'action=expandtemplates&text={{Project:Sandbox}}'
+                               => 'apihelp-expandtemplates-example-simple',
                );
        }