Skip to content

Commit 20a3d98

Browse files
New config format
1 parent 4168736 commit 20a3d98

34 files changed

+263
-124
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,35 @@ These are DPL4's configuration settings and along with their default values. To
2222

2323
| Setting | Default | Description |
2424
|:--------------------------------------------|:--------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
25-
| $wgDplSettings['allowedNamespaces'] | [] | By default all existing namespaces are used when DPL4 initializes. Customize this setting with an array of namespace constants to restrict DPL4 to work only in those namespaces. |
26-
| $wgDplSettings['allowUnlimitedCategories'] | false | Set this to true to ignore `maxCategoryCount` and allow unlimited categories. Please note that large amounts of categories in a query can slow down or crash servers. |
27-
| $wgDplSettings['allowUnlimitedResults'] | false | Set this to true to ignore `maxResultCount` and allow unlimited results. Please note that large result sets may result in slow or failed page loads. |
28-
| $wgDplSettings['alwaysCacheResults'] | false | Set this to true to ignore `allowcachedresults` and always enable the parser cache. |
29-
| $wgDplSettings['categoryStyleListCutoff'] | 6 | Maximum number of items in a category list before being cut off. |
30-
| $wgDplSettings['functionalRichness'] | 3 | Set the level of parameters available to end users. |
31-
| $wgDplSettings['maxCategoryCount'] | 8 | Maximum number of categories to allow in queries. |
32-
| $wgDplSettings['maxQueryTime'] | 10000 | Maximum allowed time for database queries in milliseconds. |
33-
| $wgDplSettings['maxResultCount'] | 500 | Maximum number of results to return from a query. |
34-
| $wgDplSettings['minCategoryCount'] | 0 | Minimum number of categories to allow in queries. |
35-
| $wgDplSettings['overrideParameterDefaults'] | [] | An associative array of parameter names and their override values. These values replace the default parameter values defined in `ParametersData`, but only if the current defaults differ. |
36-
| $wgDplSettings['queryCacheTime'] | 0 | Can help with situations where you have a template with the same query used on a large number of pages all being refreshed at once. The query cache cannot be purged. Suggested value between 30 to 600. |
37-
| $wgDplSettings['recursivePreprocess'] | true | Use `Parser::recursivePreprocess()` to improve performance by preserving the internal cache, reducing redundant template parsing. |
38-
| $wgDplSettings['recursiveTagParse'] | false | Do recursive tag parsing on `<dpl>` parser tags converting tags and functions such as magic words like `{{PAGENAME}}`. This is similar to the `{{#dpl}}` parser function call, but may not work exactly the same in all cases. |
39-
| $wgDplSettings['runFromProtectedPagesOnly'] | false | Set this to true to allow DPL4 to run from protected pages only. This is recommended if wiki administrators are having issues with malicious users creating computationally intensive queries. |
25+
| $wgDPLAllowedNamespaces | [] | By default all existing namespaces are used when DPL4 initializes. Customize this setting with an array of namespace constants to restrict DPL4 to work only in those namespaces. |
26+
| $wgDPLAllowUnlimitedCategories | false | Set this to true to ignore `$wgDPLMaxCategoryCount` and allow unlimited categories. Please note that large amounts of categories in a query can slow down or crash servers. |
27+
| $wgDPLAllowUnlimitedResults | false | Set this to true to ignore `$wgDPLMaxResultCount` and allow unlimited results. Please note that large result sets may result in slow or failed page loads. |
28+
| $wgDPLAlwaysCacheResults | false | Set this to true to ignore `allowcachedresults` and always enable the parser cache. |
29+
| $wgDPLCategoryStyleListCutoff | 6 | Maximum number of items in a category list before being cut off. |
30+
| $wgDPLFunctionalRichness | 3 | Set the level of parameters available to end users. |
31+
| $wgDPLMaxCategoryCount | 8 | Maximum number of categories to allow in queries. |
32+
| $wgDPLMaxQueryTime | 10000 | Maximum allowed time for database queries in milliseconds. |
33+
| $wgDPLMaxResultCount | 500 | Maximum number of results to return from a query. |
34+
| $wgDPLMinCategoryCount | 0 | Minimum number of categories to allow in queries. |
35+
| $wgDPLOverrideParameterDefaults | [] | An associative array of parameter names and their override values. These values replace the default parameter values defined in `ParametersData`, but only if the current defaults differ. |
36+
| $wgDPLQueryCacheTime | 0 | Can help with situations where you have a template with the same query used on a large number of pages all being refreshed at once. The query cache cannot be purged. Suggested value between 30 to 600. |
37+
| $wgDPLRecursivePreprocess | true | Use `Parser::recursivePreprocess()` to improve performance by preserving the internal cache, reducing redundant template parsing. |
38+
| $wgDPLRecursiveTagParse | false | Do recursive tag parsing on `<dpl>` parser tags converting tags and functions such as magic words like `{{PAGENAME}}`. This is similar to the `{{#dpl}}` parser function call, but may not work exactly the same in all cases. |
39+
| $wgDPLRunFromProtectedPagesOnly | false | Set this to true to allow DPL4 to run from protected pages only. This is recommended if wiki administrators are having issues with malicious users creating computationally intensive queries. |
4040

4141
The global variable `$wgNonincludableNamespaces` is automatically respected by DPL4. It will prevent the contents of the listed namespaces from appearing in DPL4's output.
4242

43-
**Note: `$wgDplSettings['maxResultCount']` is a LIMIT *on the SQL query itself*. Some DPL4 query parameters like `includematch` are applied *after* the SQL query, however, so results here may easily be misleading.**
43+
**Note: `$wgDPLMaxResultCount` is a LIMIT *on the SQL query itself*. Some DPL4 query parameters like `includematch` are applied *after* the SQL query, however, so results here may easily be misleading.**
4444

4545
### Functional Richness
4646

4747
DynamicPageList4 has many features which are unlocked based on the maximum functional richness level. There are some that can cause high CPU or database load and should be used sparingly.
4848

49-
* `$wgDplSettings['functionalRichness'] = 0` is equivalent to Wikimedia's [DynamicPageList](https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:DynamicPageList_(Wikimedia))
50-
* `$wgDplSettings['functionalRichness'] = 1` adds additional formatting parameters
51-
* `$wgDplSettings['functionalRichness'] = 2` adds performance equivalent features for templates and pagelinks
52-
* `$wgDplSettings['functionalRichness'] = 3` allows more-expensive page inclusion features and regular expression queries.
53-
* `$wgDplSettings['functionalRichness'] = 4` not recommended for public websites. Includes debugging parameters for testing and development.
49+
* `$wgDPLFunctionalRichness = 0` is equivalent to Wikimedia's [DynamicPageList](https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:DynamicPageList_(Wikimedia))
50+
* `$wgDPLFunctionalRichness = 1` adds additional formatting parameters
51+
* `$wgDPLFunctionalRichness = 2` adds performance equivalent features for templates and pagelinks
52+
* `$wgDPLFunctionalRichness = 3` allows more-expensive page inclusion features and regular expression queries.
53+
* `$wgDPLFunctionalRichness = 4` not recommended for public websites. Includes debugging parameters for testing and development.
5454

5555

5656
## Usage

extension.json

Lines changed: 59 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,65 @@
4444
}
4545
},
4646
"config": {
47-
"DplSettings": {
48-
"value": {
49-
"allowedNamespaces": [],
50-
"allowUnlimitedCategories": false,
51-
"allowUnlimitedResults": false,
52-
"alwaysCacheResults": false,
53-
"categoryStyleListCutoff": 6,
54-
"functionalRichness": 3,
55-
"maxCategoryCount": 8,
56-
"maxQueryTime": 10000,
57-
"maxResultCount": 500,
58-
"minCategoryCount": 0,
59-
"overrideParameterDefaults": [],
60-
"queryCacheTime": 0,
61-
"recursivePreprocess": true,
62-
"recursiveTagParse": false,
63-
"runFromProtectedPagesOnly": false
64-
}
47+
"DPLAllowedNamespaces": {
48+
"description": "Namespaces DynamicPageList4 is allowed to query.",
49+
"value": []
50+
},
51+
"DPLAllowUnlimitedCategories": {
52+
"description": "Allow unlimited categories in a DPL query.",
53+
"value": false
54+
},
55+
"DPLAllowUnlimitedResults": {
56+
"description": "Allow unlimited result counts in a DPL query.",
57+
"value": false
58+
},
59+
"DPLAlwaysCacheResults": {
60+
"description": "Always cache DPL query results.",
61+
"value": false
62+
},
63+
"DPLCategoryStyleListCutoff": {
64+
"description": "Cutoff for switching category style list formatting.",
65+
"value": 6
66+
},
67+
"DPLFunctionalRichness": {
68+
"description": "Controls which DPL features are enabled.",
69+
"value": 3
70+
},
71+
"DPLMaxCategoryCount": {
72+
"description": "Maximum number of categories allowed in a DPL query.",
73+
"value": 8
74+
},
75+
"DPLMaxQueryTime": {
76+
"description": "Maximum execution time for a DPL query (ms).",
77+
"value": 10000
78+
},
79+
"DPLMaxResultCount": {
80+
"description": "Maximum number of pages returned by a DPL query.",
81+
"value": 500
82+
},
83+
"DPLMinCategoryCount": {
84+
"description": "Minimum number of categories required in a DPL query.",
85+
"value": 0
86+
},
87+
"DPLOverrideParameterDefaults": {
88+
"description": "Overrides default values for DPL parameters.",
89+
"value": []
90+
},
91+
"DPLQueryCacheTime": {
92+
"description": "Cache lifetime for DPL queries (seconds).",
93+
"value": 0
94+
},
95+
"DPLRecursivePreprocess": {
96+
"description": "Enable recursive preprocessing of DPL output.",
97+
"value": true
98+
},
99+
"DPLRecursiveTagParse": {
100+
"description": "Enable recursive parsing of DPL tags.",
101+
"value": false
102+
},
103+
"DPLRunFromProtectedPagesOnly": {
104+
"description": "Restrict DPL usage to protected pages only.",
105+
"value": false
65106
}
66107
},
67108
"TrackingCategories": [

i18n/bn.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"dpl_log_21": "কোয়েরি: <code>$0</code>",
1414
"dpl_log_22": "সতর্কতা: '$1'-এর জন্য কোনো প্যারামিটার বিকল্প সরবরাহ করা হয়নি। ('=' অনুপস্থিত)",
1515
"dpl_log_23": "ত্রুটি: সার্ভার ওভারলোড হওয়ার কারণে তালিকা প্রদর্শন করা যাচ্ছে না। অনুগ্রহ করে কিছুক্ষণ পর আবার চেষ্টা করুন।",
16-
"dpl_log_24": "ত্রুটি: <code>$wgDplSettings['runFromProtectedPagesOnly']</code> নির্ধারণ করা আছে, তবে '$1' পাতাটি সম্পাদনা সুরক্ষিত নয়।",
16+
"dpl_log_24": "ত্রুটি: <code>$wgDPLRunFromProtectedPagesOnly</code> নির্ধারণ করা আছে, তবে '$1' পাতাটি সম্পাদনা সুরক্ষিত নয়।",
1717
"dpl_log_25": "ত্রুটি: $1",
1818
"dpl_query_error": "DynamicPageList4 এক্সটেনশন (সংস্করণ $1) একটি SQL স্টেটমেন্ট উৎপন্ন করেছে যা ডাটাবেস ত্রুটির দিকে নিয়ে গেছে।<br/> এটি DynamicPageList4-এর অভ্যন্তরীণ ত্রুটি বা আপনার করা ত্রুটির কারণে হতে পারে; বিশেষ করে যখন 'categoryregexp' বা 'titleregexp'-এর মতো পরামিতি ব্যবহার করা হয় তখন এটি হতে পারে। নন-গ্রিডি *? মিলকরণ প্যাটার্ন সমর্থিত নয়।<br/> ত্রুটির বার্তাটি হলো:<br/><code>$2</code>",
1919
"dpl-tag-tracking-category": "DynamicPageList4 পার্সার ট্যাগ ব্যবহার করা পাতা"

i18n/ce.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"dpl-desc": "Лаккхара говза йолу хаамийн генератор йу MediaWikis",
1515
"dpl_log_1": "ГӀалат: нийса йоцу параметр '$1': '$2'! ГӀо: <code>$1= <i>баьсса могӀа</i> (Main)$3</code>.",
1616
"dpl_log_2": "ГӀалат: нийса йоцу параметр '$1': '$2'! ГӀо: <code>$1= <i>йуьззина агӀонан цӀе</i></code>.",
17-
"dpl_log_3": "ГӀалат: Дукха категореш йу! Максимум: $1. ГӀо: <code>$wgDplSettings['maxCategoryCount']</code> совйаккха, кхин а категореш билгалйаха, йа хӀоттаде <code>$wgDplSettings['allowUnlimitedCategories'] = true;</code> доза дӀадаккха. (Хийцам хӀоттабе вики конфигурацин файлехь <code>LocalSettings.php</code>.)",
18-
"dpl_log_4": "ГӀалат: ТӀех кӀезиг категореш йу! Минимум: $1. ГӀо: лахде <code>$wgDplSettings['minCategoryCount']</code> кӀезиг категореш билгалйаха. (Хийцам хӀоттабе викин <code>LocalSettings.php</code> конфигурацин файлехь.)",
17+
"dpl_log_3": "ГӀалат: Дукха категореш йу! Максимум: $1. ГӀо: <code>$wgDPLMaxCategoryCount</code> совйаккха, кхин а категореш билгалйаха, йа хӀоттаде <code>$wgDPLAllowUnlimitedCategories = true;</code> доза дӀадаккха. (Хийцам хӀоттабе вики конфигурацин файлехь <code>LocalSettings.php</code>.)",
18+
"dpl_log_4": "ГӀалат: ТӀех кӀезиг категореш йу! Минимум: $1. ГӀо: лахде <code>$wgDPLMinCategoryCount</code> кӀезиг категореш билгалйаха. (Хийцам хӀоттабе викин <code>LocalSettings.php</code> конфигурацин файлехь.)",
1919
"dpl_log_5": "ГӀалат: Цхьа а критери ца карийна! Мел кӀезга а цхьаъ лело йеза хӀокху параметрех: «category», «namespace», «titlematch», «linksto», «uses», «createdby», «modificationby», «lastmodifiedby» йа церан «not» варианташ",
2020
"dpl_log_6": "ГӀалат: «addfirstcategorydate=true» йа «ordermethod=categoryadd» лело лаххара а цхьа категори харжа йеза.",
2121
"dpl_log_7": "ГӀалат: нагахь санна ахь цхьаннал сов категори йукъайаьккхича, лело йиш йац «addfirstcategorydate=true» йа «ordermethod=categoryadd».",
@@ -35,7 +35,7 @@
3535
"dpl_log_21": "Дехар: <code>$0</code>",
3636
"dpl_log_22": "Тергам: «$1» параметран опци ца йелла. («=» йац)",
3737
"dpl_log_23": "ГӀалат: Серверш тӀехсов лелош хиларна, могӀам гайта йиш йац. Дехар до, тӀаьхьо хьажа.",
38-
"dpl_log_24": "ГӀалат: <code>$wgDplSettings['runFromProtectedPagesOnly']</code> дӀахӀоттийна, амма '$1' агӀо хийцарх ларйина йац.",
38+
"dpl_log_24": "ГӀалат: <code>$wgDPLRunFromProtectedPagesOnly</code> дӀахӀоттийна, амма '$1' агӀо хийцарх ларйина йац.",
3939
"dpl_log_25": "ГӀалат: $1",
4040
"dpl_articlecount": "{{PLURAL:$1|цхьа йаззам бу|$1 йаззам бу}} хӀокху корта чохь.",
4141
"dpl_query_error": "DynamicPageList4 шордаро (верси $1) SQL дӀахьедар дина, цо кхачийна База гӀалаташ.<br/>Бахьана хила тарло DynamicPageList4 чоьхьара гӀалаташ йа ахь дина гӀалаташ; къаьсттина «categoryregexp» йа «titleregexp» санна йолу параметраш лелош. Комаьрша йоцу <code>*?</code> нийса йогӀучу кепаш лелор ловш дац.<br/>ГӀалатах хаам бар:<br/><code>$2</code>",

0 commit comments

Comments
 (0)