Help:Configuration parameter "$maxRecursionDepth"

Jump to: navigation, search
edit with form (experimental)

Title $maxRecursionDepth
Description Sets the recursion depth for a template output
Important noteImportant Note: Change this configuration parameter at your own risk.
Default setting
Software Semantic MediaWiki
First version supported 1.4.0
Last version supported still available
Configuration Query settings · inline queries
Keyword Query · template output · template format

$maxRecursionDepth is a configuration parameter that sets the recursion depth for a template output, e.g. the template format. The setting was introduced in Semantic MediaWiki 1.4.0.

Some query printers may return wiki code that comes from other pages, e.g. from templates that are used in formatting or from embedded result pages. Both kinds of pages may contain inline queries that do again use new pages, so we must care about recursion. We do so by simply counting how often this method starts a subparse and stopping at depth "2".

There is one special case: if this method is called outside parsing, and the concrete printer returns wiki text, and wiki text is requested, then we may return wiki text with sub-queries to the caller. If the caller parses this (which is likely) then this will again call us in parse-context and all recursion checks catch. Only the first level of parsing is done outside and thus not counted. Thus you effectively can get down to level 3.

Default setting

$maxRecursionDepth = 2;
NoteNote: This setting is not done in the "DefaultSettings.php" file but in the "ResultPrinter.php" file around line 148 which is located at /includes/queryprinters .

Changing the default setting

To modify this configuration setting, add the following to your "LocalSettings.php" file after the enableSemantics() call:

SMWResultPrinter::$maxRecursionDepth = 5;
Important noteImportant Note: This setting should be adjusted very carefully to avoid unbalanced recursive loops. Do this at your own risk.

See also