Extension:IDProvider/pl

Category:MIT licensed extensions/pl
Podręcznik rozszerzeń MediaWiki
IDProvider
Status wydania: stabilneCategory:Stable extensions/pl
Realizacja Funkcja parsera Category:Parser function extensions/pl
Opis Provides IDs using different ID algorithms
Autor(zy) Simon Heimler, Alexander Gesinn
Opiekun(owie) gesinn.it
Ostatnia wersja 3.0.0 (2024-12-16)
MediaWiki 1.39+Category:Extensions with manual MediaWiki version/pl
Zmiany w bazie danych Tak
Composer gesinn-it/id-provider Category:Extensions supporting Composer/pl
Licencja Licencja MIT
Pobieranie Category:Extensions in GitHub version control/pl
Category:All extensions/plCategory:Extensions not in ExtensionJson/pl

The IDProvider extension provides the generation of (unique) IDs through different ID algorithms. They can be accessed through parser functions, API or as a static PHP function.

Installation

  • Download, extract i umieść plik(i) w katalogu o nazwie IDProvider w swoim katalogu extensions/.
  • Dodaj poniższy kod na dole twojego pliku LocalSettings.php :
    wfLoadExtension( 'IDProvider' );
    
  • Uruchom skrypt aktualizujący, który automatycznie stworzy potrzebne tabele dla tego rozszerzenia.
  • Yes Zrobione – Przejdź do Special:Version na twojej wiki, aby sprawdzić czy rozszerzenie zostało pomyślnie zainstalowane.


Installation via Composer is broken.

Użycie

The ApiSandbox will display and document all available options. All parameters are given as key values and work the same way whether you use the parser function, api or a static php call.

Through parser functions

This makes most sense in combination with Page Forms. There it can be used for auto-creating unique page titles.

You should avoid spaces within the parser functions if you use it as a parameter of a Page Form info tag.
{{{info|page name={{#idprovider-increment:Feature_|padding=5}} }}}

#idprovider-increment

{{#idprovider-increment:}}
{{#idprovider-increment:Issue_}}
{{#idprovider-increment:
  |prefix=Issue_
  |padding=5
  |skipUniqueTest=true
}}

#idprovider-random

{{#idprovider-random:}}
{{#idprovider-random:uuid}}
{{#idprovider-random:fakeid}}
{{#idprovider-random:
  |type=uuid
  |skipUniqueTest=true
}}

Through the API

#idprovider-increment

  • api.php?action=idprovider-increment
  • api.php?action=idprovider-increment&prefix=Issue_&padding=8&skipUniqueTest=true

#idprovider-random

  • api.php?action=idprovider-random&type=uuid
  • api.php?action=idprovider-random&type=fakeid&prefix=Issue_&skipUniqueTest=true

IDProvider Example

Through a static PHP call

For more examples, take a look at the unit-tests.

IDProviderFunctions::getIncrement

$id = IDProviderFunctions::getIncrement([
	'prefix' => '___TEST___',
	'padding' => 8,
]);

IDProviderFunctions::getRandom

$id = IDProviderFunctions::getRandom([
	'type' => 'fakeid',
	'prefix' => 'PREFIX_',
]);

Zobacz też

  • Extension:IDGenerator - Provides a parser function for numeric IDs. Alternative to IDProvider that can be installed via Composer.
Category:Extensions by gesinn.it/pl
Category:All extensions/pl Category:BeforePageDisplay extensions/pl Category:Extensions by gesinn.it/pl Category:Extensions in GitHub version control/pl Category:Extensions included in semantic::core/pl Category:Extensions not in ExtensionJson/pl Category:Extensions supporting Composer/pl Category:Extensions with manual MediaWiki version/pl Category:MIT licensed extensions/pl Category:ParserFirstCallInit extensions/pl Category:Parser function extensions/pl Category:Stable extensions/pl