Compatibility

From DynamicPageList3 Manual
Revision as of 20:39, 20 March 2015 by wikia:help>Azxiana

Template:DPL Manual

DynamicPageList3 contains all functionality of the Intersection extension and previous versions of DynamicPageList.

Migration Aid

In the standard configuration DPL registers the <DynamicPageList> tag. This is needed to be downward compatible with extension 'Intersection'.

During transitioning you may want to install DPL in parallel to 'Intersection' for testing. Simply configure add the configuration line

$dplMigrationTesting = true;

and DPL will then only register a tag called <Intersection>. With this configuration try changing some of the existing calls of 'Intersection' (which use the <DynamicPageList> tag) to the <Intersection> tag. Once the data has been tested and verified that it produces identical results simply remove the

$dplMigrationTesting

line.

Messages

The 'i18n' files of 'Intersection' and DPL have been merged. There are some messages which are semantically identical in 'Intersection' and DPL (although they have a different technical key). If the <DynamicPageList> tag is used, DPL will have a preference for these old messages.

Levels of Functionality

After the migration to DPL the <DynamicPageList> tag will offer exactly the same functionality as the former Extension:Intersection.

Furthermore, there will be the <dpl> tag available and the {{#dpl: ... }} parser function. They will by default offer their whole functionality - which may be a little bit more than you want.

Calling

  ExtDynamicPageList::setFunctionalRichness(0);

will ensure that they behave identical to Extension:Intersection.

Your LocalSettings.php might contain the following entries:

require_once( "$IP/extensions/DynamicPageList/DynamicPageList.php" );
# the next statement served only for migration and is now commented out:
# require_once( "$IP/extensions/DynamicPageList/DynamicPageListMigration.php" );
ExtDynamicPageList::$options['RunFromProtectedPagesOnly'] = 
      'Extension DPL (warning): current configuration '.
      'allows execution of DPL code from protected pages only.";
ExtDynamicPageList::$maxResultCount = 100;
ExtDynamicPageList::$allowUnlimitedResults = false; 
ExtDynamicPageList::$respectParserCache = true;
ExtDynamicPageList::setFunctionalRichness(0);

This would be a VERY conservative setting which allows DPL to run from protected pages only, restricting result sets to 100 pages, without real dynamic behaviour and with DPL tags offering nothing else but the mere functionality of extension:Intersection.

We recommend to

  • allow DPL to run also on non-protected pages (as is true for Extension:Intersection)
  • accept the default limitation of 500 pages as a maximum result size or even increase that number
  • configure true dynamic behaviour (using the dplcache where appropriate)
  • select 2,3 or 4 as your level of functional richness.

If you follow this guideline the only statement you would need (after the require_once()) is the call to setFunctionalRichness().

The level of functional richness has 5 values. Each DPL command belongs to exactly one of these levels. They are defined in the ParametersData class.

static private $parametersForRichnessLevel = [
	0 => [
		'addfirstcategorydate',
		'category',
		'count',
		'hiddencategories',
		'mode',
		'namespace',
		'notcategory',
		'order',
		'ordermethod',
		'qualitypages',
		'redirects',
		'showcurid',
		'shownamespace',
		'stablepages',
		'suppresserrors'
	],
	1 => [
		'allowcachedresults',
		'execandexit',
		'columns',
		'debug',
		'distinct',
		'escapelinks',
		'format',
		'inlinetext',
		'listseparators',
		'notnamespace',
		'offset',
		'oneresultfooter',
		'oneresultheader',
		'ordercollation',
		'noresultsfooter',
		'noresultsheader',
		'randomcount',
		'replaceintitle',
		'resultsfooter',
		'resultsheader',
		'rowcolformat',
		'rows',
		'rowsize',
		'scroll',
		'title',
		'titlelt',
		'titlegt',
		'titlemaxlength',
		'userdateformat'
	],
	2 => [
		'addauthor',
		'addcategories',
		'addcontribution',
		'addeditdate',
		'addexternallink',
		'addlasteditor',
		'addpagecounter',
		'addpagesize',
		'addpagetoucheddate',
		'adduser',
		'cacheperiod',
		'categoriesminmax',
		'createdby',
		'dominantsection',
		'eliminate',
		'fixcategory',
		'headingcount',
		'headingmode',
		'hitemattr',
		'hlistattr',
		'ignorecase',
		'imagecontainer',
		'imageused',
		'include',
		'includematch',
		'includematchparsed',
		'includemaxlength',
		'includenotmatch',
		'includenotmatchparsed',
		'includepage',
		'includesubpages',
		'includetrim',
		'itemattr',
		'lastmodifiedby',
		'linksfrom',
		'linksto',
		'linkstoexternal',
		'listattr',
		'minoredits',
		'modifiedby',
		'multisecseparators',
		'notcreatedby',
		'notlastmodifiedby',
		'notlinksfrom',
		'notlinksto',
		'notmodifiedby',
		'notuses',
		'reset',
		'secseparators',
		'skipthispage',
		'table',
		'tablerow',
		'tablesortcol',
		'titlematch',
		'usedby',
		'uses'
	],
	3 => [
		'allrevisionsbefore',
		'allrevisionssince',
		'articlecategory',
		'categorymatch',
		'categoryregexp',
		'firstrevisionsince',
		'lastrevisionbefore',
		'maxrevisions',
		'minrevisions',
		'notcategorymatch',
		'notcategoryregexp',
		'nottitlematch',
		'nottitleregexp',
		'openreferences',
		'titleregexp'
	],
	4 => [
		'deleterules',
		'goal',
		'updaterules'
	]
];
 level=0 will not allow any additional functionality (compared to Extension:Intersection).
 level=1 brings a series of small formatting improvements which will not affect performance
 level=2 brings some additional features which are roughly on the same level of database load
         as the basic functionality; it also contains content transclusion (which may require
         the dpl-cache on huge websites)
 level=3 brings more new features: selection based on regular expressions,
         queries on revision level
 level=4 adds a few additional features which are useful for private websites (like batch updates)
         but should not be made available on huge public websites.