Kézikönyv:$wgContentHandlers
Content handlers and storage: $wgContentHandlers | |
---|---|
Tartalomtípus-kezelők konfigurálása. |
|
Bevezetve: | 1.21.0 |
Eltávolítva: | használatban |
Megengedett értékek: | (Tartalmimodell-azonosító konstansainak tömbje) |
Alapértelmezett érték: | (lásd alább) |
Egyéb beállítások: Betűrendben | Funkció szerint |
Részletek
A változó a tartalmi modell kezelésével kapcsolatos beépülő modulokat engedélyezni. A tömb minden bejegyzése az adott modellazonosítót egy PHP-osztálynévhez rendeli hozzá.
MediaWiki-verzió: | 1.34 |
When undeploying an extension that provides handling for a content model, that content model becomes unsupported, leading to MWUnknownContentModelExceptions to be raised. To avoid this, the content model in question can be defined to use the UnknownContentHandler
:
$wgContentHandlers['foo-bar'] = 'UnknownContentHandler';
This allows pages that use the new unsupported content model to still be accessible, even though their content can no longer be shown.
Alternatively, if the content model in question is a text based model, it can be re-defined to be handled as plain text:
$wgContentHandlers['foo-bar'] = 'TextContentHandler';
The content of pages that use this content model remain readable and editable, but lose any special capabilities and markup support.
Alapértelmezett érték
MediaWiki-verzió: | ≥ 1.41 |
$wgContentHandlers = [
// a leggyakoribb eset
CONTENT_MODEL_WIKITEXT => [
'class' => WikitextContentHandler::class,
'services' => [
'TitleFactory',
'ParserFactory',
'GlobalIdGenerator',
'LanguageNameUtils',
'LinkRenderer',
'MagicWordFactory',
'ParsoidParserFactory',
],
],
// butított változat, nincs szintaxiskiemelés
CONTENT_MODEL_JAVASCRIPT => JavaScriptContentHandler::class,
// egyszerű implementáció, kiterjesztések általi használathoz stb.
CONTENT_MODEL_JSON => JsonContentHandler::class,
// butított változat, nincs szintaxiskiemelés
CONTENT_MODEL_CSS => CssContentHandler::class,
// egyszerű szöveg, kiterjesztések általi használathoz stb.
CONTENT_MODEL_TEXT => TextContentHandler::class,
// fallback for unknown models, from imports or extensions that were removed
CONTENT_MODEL_UNKNOWN => FallbackContentHandler::class,
];
MediaWiki-verzió: | 1.40 |
$wgContentHandlers = [
// the usual case
CONTENT_MODEL_WIKITEXT => [
'class' => WikitextContentHandler::class,
'services' => [
'TitleFactory',
'ParserFactory',
'GlobalIdGenerator',
'LanguageNameUtils',
'MagicWordFactory',
],
],
// dumb version, no syntax highlighting
CONTENT_MODEL_JAVASCRIPT => JavaScriptContentHandler::class,
// simple implementation, for use by extensions, etc.
CONTENT_MODEL_JSON => JsonContentHandler::class,
// dumb version, no syntax highlighting
CONTENT_MODEL_CSS => CssContentHandler::class,
// plain text, for use by extensions, etc.
CONTENT_MODEL_TEXT => TextContentHandler::class,
// fallback for unknown models, from imports or extensions that were removed
CONTENT_MODEL_UNKNOWN => FallbackContentHandler::class,
];
MediaWiki-verziók: | 1.36 – 1.39 |
$wgContentHandlers = [
// the usual case
CONTENT_MODEL_WIKITEXT => WikitextContentHandler::class,
// dumb version, no syntax highlighting
CONTENT_MODEL_JAVASCRIPT => JavaScriptContentHandler::class,
// simple implementation, for use by extensions, etc.
CONTENT_MODEL_JSON => JsonContentHandler::class,
// dumb version, no syntax highlighting
CONTENT_MODEL_CSS => CssContentHandler::class,
// plain text, for use by extensions, etc.
CONTENT_MODEL_TEXT => TextContentHandler::class,
// fallback for unknown models, from imports or extensions that were removed
CONTENT_MODEL_UNKNOWN => FallbackContentHandler::class,
];
MediaWiki-verziók: | 1.31 – 1.35 |
$wgContentHandlers = [
// the usual case
CONTENT_MODEL_WIKITEXT => WikitextContentHandler::class,
// dumb version, no syntax highlighting
CONTENT_MODEL_JAVASCRIPT => JavaScriptContentHandler::class,
// simple implementation, for use by extensions, etc.
CONTENT_MODEL_JSON => JsonContentHandler::class,
// dumb version, no syntax highlighting
CONTENT_MODEL_CSS => CssContentHandler::class,
// plain text, for use by extensions, etc.
CONTENT_MODEL_TEXT => TextContentHandler::class,
];
MediaWiki-verziók: | 1.24 – 1.30 |
$wgContentHandlers = [
// the usual case
CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler',
// dumb version, no syntax highlighting
CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler',
// simple implementation, for use by extensions, etc.
CONTENT_MODEL_JSON => 'JsonContentHandler',
// dumb version, no syntax highlighting
CONTENT_MODEL_CSS => 'CssContentHandler',
// plain text, for use by extensions, etc.
CONTENT_MODEL_TEXT => 'TextContentHandler',
];
MediaWiki-verziók: | 1.21 – 1.23 |
$wgContentHandlers = array(
// the usual case
CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler',
// dumb version, no syntax highlighting
CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler',
// dumb version, no syntax highlighting
CONTENT_MODEL_CSS => 'CssContentHandler',
// plain text, for use by extensions etc
CONTENT_MODEL_TEXT => 'TextContentHandler',
);