Compatibility: Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
m (Azxiana moved page Compatibility to DPL:Compatibility without leaving a redirect)
imported>FrozenPlum
m (FrozenPlum moved page Extension:DPL3/Compatibility to Compatibility)
 
(15 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Type Manual|section=Compatibility}}
{{DPL manual|section=Compatibility}}


'''DynamicPageList3''' contains all functionality of the Intersection extension and previous versions of DynamicPageList. Standardization has been applied to various parameters to make them use consistent behavior so minor tweaking may be necessary to queries when migrating from DynamicPageList 1 or 2.
As said before, since release 1.8.2 DPL contains all functionality of Extension:Intersection.


==Migrating settings==
==== Migration aid ====
DynamicPageList and DynamicPageList2 settings will need to be updated to use the new variable names and standardize the syntax. Please see [https://www.mediawiki.org/wiki/Extension:DynamicPageList3 DynamicPageList3 on MediaWiki Wiki] for complete documentation on settings.
Example, if your configuration has:
<pre><nowiki>ExtDynamicPageList::$functionalRichness = 3;</nowiki></pre>
Would be changed to:
<pre><nowiki>$wgDplSettings['functionalRichness'] = 3;</nowiki></pre>


==Migration aid from Extension:Intersection==
In the standard configuration DPL registers the &lt;DynamicPageList&gt; tag. This is needed to be downward compatible with extension 'Intersection'.
In the standard configuration DPL registers the &lt;DynamicPageList&gt; tag. This is needed to be downward compatible with extension 'Intersection'.


In the transition phase you may want to install DPL in PARALLEL to 'Intersection' for testing. DPL offers a second entry point for that purpose. Instead of require_once("DynamicPageList.php") you have to use require_once("DPLMigration.php"). DPL will then ONLY register a tag called &lt;Intersection&gt;
During transitioning it may be desirable to install DPL in parallel to 'Intersection' for testing. Add the configuration line <code><nowiki>$dplMigrationTesting = true;</nowiki></code> before the extension inclusion and DPL will then only register a tag called &lt;Intersection&gt;.


In this constellation you can change some of your existing calls of 'Intersection' (which use the &lt;DynamicPageList&gt; tag) to the &lt;Intersection&gt; tag. Once you are convinced that this produces identical results and works with equal efficiency you can change to require_once("DynamicPageList.php"). Don't forget to change the statements back to the &lt;DynamicPageList&gt; tag!. Of course you must also remove the require_once() for the Intersection extension.
With this configuration try changing some of the existing calls of 'Intersection' (which use the &lt;DynamicPageList&gt; tag) to the &lt;Intersection&gt; tag. Once the data has been tested and verified that it produces identical results simply remove the <nowiki>$dplMigrationTesting</nowiki> line.


After the migration to DPL the &lt;DynamicPageList&gt; tag will offer exactly the same functionality as the former Extension:Intersection. Furthermore, there will be the &lt;dpl&gt; tag available and the <code><nowiki>{{#dpl: ... }}</nowiki></code> parser function. They will by default offer their whole functionality. Please see the section below for configuring DynamicPageList to use more restrictive functionality.
==== Messages ====


==Levels of functionality==
The 'i18n' files of 'Intersection' and DPL have been merged.
To change the parameter richness level change the configuration for:
There are some messages which are semantically identical in 'Intersection' and DPL (although they have a different technical key). If the &lt;DynamicPageList&gt; tag is used, DPL will have a preference for these old messages.


<code>$wgDplSettings['functionalRichness'] = 3;</code>
==== Levels of Functionality ====


There are five levels of parameter richness from 0 to 4. Enabling a numerically higher richness level enables all the parameters in the levels below it as well. The levels are defined in the ParametersData class and copied here for quick reference.
After the migration to DPL the &lt;DynamicPageList&gt; tag will offer exactly the same functionality as the former Extension:Intersection.


* Level 0 - Identical functionality to Intersection extension.
Furthermore, there will be the &lt;dpl&gt; tag available and the <nowiki>{{#dpl: ... }}</nowiki> parser function. They will by default offer their whole functionality - which may be a little bit more than you want.
* Level 1 - Includes additional formatting and output options.

* Level 2 - Database query refinement parameters that have minimal performance impact. Also includes parameters for content transclusion.
Calling
* Level 3 - More query parameters that can have a higher database impact and should be carefully tested for performance impacts.
ExtDynamicPageList::setFunctionalRichness(0);
* Level 4 - A few features for development purposes and batch updating. Not recommend to be enabled on public web sites.
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'] =
'<small><i>Extension DPL (warning): current configuration '.
'allows execution of DPL code from protected pages only.</i></small>";
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 near line 860 in 'DPLSetup.php':


<pre>
<pre>
static private $parametersForRichnessLevel = [
0 => '
0 => [
addfirstcategorydate
'addfirstcategorydate',
category
'category',
count
'count',
mode
'hiddencategories',
namespace
'mode',
notcategory
'namespace',
order
'notcategory',
ordermethod
'order',
qualitypages
'ordermethod',
redirects
'qualitypages',
showcurid
'redirects',
shownamespace
'showcurid',
stablepages
'shownamespace',
suppresserrors
',
'stablepages',
'suppresserrors'
1 => '
],
allowcachedresults
1 => [
execandexit
'allowcachedresults',
columns
'execandexit',
debug
'columns',
distinct
'debug',
escapelinks
'distinct',
format
'escapelinks',
inlinetext
'format',
listseparators
'inlinetext',
notnamespace
'listseparators',
offset
'notnamespace',
oneresultfooter
'offset',
oneresultheader
'oneresultfooter',
ordercollation
'oneresultheader',
noresultsfooter
'ordercollation',
noresultsheader
'noresultsfooter',
randomcount
'noresultsheader',
randomseed
'randomcount',
replaceintitle
'replaceintitle',
resultsfooter
'resultsfooter',
resultsheader
'resultsheader',
rowcolformat
'rowcolformat',
rows
'rows',
rowsize
'rowsize',
titlemaxlength
'scroll',
userdateformat
',
'title',
'titlelt',
2 => '
'titlegt',
addauthor
'titlemaxlength',
addcategories
'userdateformat'
addcontribution
],
addeditdate
2 => [
addexternallink
'addauthor',
addlasteditor
'addcategories',
addpagecounter
'addcontribution',
addpagesize
'addeditdate',
addpagetoucheddate
'addexternallink',
adduser
'addlasteditor',
categoriesminmax
'addpagecounter',
createdby
'addpagesize',
dominantsection
'addpagetoucheddate',
dplcache
'adduser',
dplcacheperiod
'cacheperiod',
eliminate
'categoriesminmax',
headingcount
'createdby',
headingmode
'dominantsection',
hitemattr
'eliminate',
hlistattr
'fixcategory',
ignorecase
'headingcount',
imagecontainer
'headingmode',
imageused
'hitemattr',
include
'hlistattr',
includematch
'ignorecase',
includematchparsed
'imagecontainer',
includemaxlength
'imageused',
includenotmatch
'include',
includenotmatchparsed
'includematch',
includepage
'includematchparsed',
includesubpages
'includemaxlength',
includetrim
'includenotmatch',
itemattr
'includenotmatchparsed',
lastmodifiedby
'includepage',
linksfrom
'includesubpages',
linksto
'includetrim',
linkstoexternal
'itemattr',
listattr
'lastmodifiedby',
minoredits
'linksfrom',
modifiedby
'linksto',
multisecseparators
'linkstoexternal',
notcreatedby
'listattr',
notlastmodifiedby
'minoredits',
notlinksfrom
'modifiedby',
notlinksto
'multisecseparators',
notmodifiedby
'notcreatedby',
notuses
'notlastmodifiedby',
reset
'notlinksfrom',
secseparators
'notlinksto',
skipthispage
'notmodifiedby',
table
'notuses',
tablerow
'reset',
tablesortcol
'secseparators',
title
'skipthispage',
titlematch
'table',
usedby
'tablerow',
uses
',
'tablesortcol',
'titlematch',
3 => '
'usedby',
allrevisionsbefore
'uses'
allrevisionssince
],
articlecategory
3 => [
categorymatch
'allrevisionsbefore',
categoryregexp
'allrevisionssince',
firstrevisionsince
'articlecategory',
lastrevisionbefore
'categorymatch',
maxrevisions
'categoryregexp',
minrevisions
'firstrevisionsince',
notcategorymatch
'lastrevisionbefore',
notcategoryregexp
'maxrevisions',
nottitlematch
'minrevisions',
nottitleregexp
'notcategorymatch',
openreferences
'notcategoryregexp',
titleregexp
',
'nottitlematch',
'nottitleregexp',
4 => '
'openreferences',
deleterules
'titleregexp'
goal
],
updaterules
4 => [
',
'deleterules',
'goal',
'updaterules'
]
];
</pre>


<!-- Extension prefix in other languages:
</pre>


[[de:Erweiterung:{{subst:BASEPAGENAME}}]]
level=0 will not allow any additional functionality (compared to Extension:Intersection).
[[es:Extensión:{{subst:BASEPAGENAME}}]]
level=1 brings a series of small formatting improvements which will not affect performance
[[fr:Extension:{{subst:BASEPAGENAME}}]]
level=2 brings some additional features which are roughly on the same level of database load
[[it:Estensione:{{subst:BASEPAGENAME}}]]
as the basic functionality; it also contains content transclusion (which may require
[[nl:Uitbreiding:{{subst:BASEPAGENAME}}]]
the dpl-cache on huge websites)
[[pl:Rozszerzenie:{{subst:BASEPAGENAME}}]]
level=3 brings more new features: selection based on regular expressions,
[[pt:Extensão:{{subst:BASEPAGENAME}}]]
queries on revision level
[[ru:Расширение:{{subst:BASEPAGENAME}}]]
level=4 adds a few additional features which are useful for private websites (like batch updates)
[[zh:扩展:{{subst:BASEPAGENAME}}]]
but should not be made available on huge public websites.
-->

Latest revision as of 01:44, 29 March 2022

Manual Compatibility

DynamicPageList3 contains all functionality of the Intersection extension and previous versions of DynamicPageList. Standardization has been applied to various parameters to make them use consistent behavior so minor tweaking may be necessary to queries when migrating from DynamicPageList 1 or 2.

Migrating settings

DynamicPageList and DynamicPageList2 settings will need to be updated to use the new variable names and standardize the syntax. Please see DynamicPageList3 on MediaWiki Wiki for complete documentation on settings. Example, if your configuration has:

ExtDynamicPageList::$functionalRichness = 3;

Would be changed to:

$wgDplSettings['functionalRichness'] = 3;

Migration aid from Extension:Intersection

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

During transitioning it may be desirable to install DPL in parallel to 'Intersection' for testing. Add the configuration line $dplMigrationTesting = true; before the extension inclusion 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.

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. Please see the section below for configuring DynamicPageList to use more restrictive functionality.

Levels of functionality

To change the parameter richness level change the configuration for:

$wgDplSettings['functionalRichness'] = 3;

There are five levels of parameter richness from 0 to 4. Enabling a numerically higher richness level enables all the parameters in the levels below it as well. The levels are defined in the ParametersData class and copied here for quick reference.

  • Level 0 - Identical functionality to Intersection extension.
  • Level 1 - Includes additional formatting and output options.
  • Level 2 - Database query refinement parameters that have minimal performance impact. Also includes parameters for content transclusion.
  • Level 3 - More query parameters that can have a higher database impact and should be carefully tested for performance impacts.
  • Level 4 - A few features for development purposes and batch updating. Not recommend to be enabled on public web sites.
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'
	]
];