PHPackages                             professional-wiki/id-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. professional-wiki/id-generator

ActiveMediawiki-extension

professional-wiki/id-generator
==============================

Provides a parser function to generate unique incremental numeric IDs

1.0.0(6y ago)53701[1 issues](https://github.com/ProfessionalWiki/IdGenerator/issues)BSD-3-ClausePHPPHP &gt;=7.1

Since Jan 27Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/ProfessionalWiki/IdGenerator)[ Packagist](https://packagist.org/packages/professional-wiki/id-generator)[ Docs](https://github.com/ProfessionalWiki/IdGenerator)[ RSS](/packages/professional-wiki-id-generator/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

ID Generator
============

[](#id-generator)

[![Build Status](https://camo.githubusercontent.com/96a5906860a2060714375accb43e6ae0a574f9afc4de6cc883f303e2cbac8654/68747470733a2f2f7472617669732d63692e6f72672f50726f66657373696f6e616c57696b692f496447656e657261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ProfessionalWiki/IdGenerator)[![Code Coverage](https://camo.githubusercontent.com/d7f78d4d52e678f31fc312ef1ddaaf3412b8e983492e953f4225a84f1366eca9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f50726f66657373696f6e616c57696b692f496447656e657261746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ProfessionalWiki/IdGenerator/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/87d667564c30fd542dafb062ef541e71f8e73ee8ac7bc140bd611f3650048ff7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f50726f66657373696f6e616c57696b692f496447656e657261746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ProfessionalWiki/IdGenerator/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/e251bbf421dab654a9b1a932d3dd01c4394de734062d312bb61aa04bb0312b9a/68747470733a2f2f706f7365722e707567782e6f72672f70726f66657373696f6e616c2d77696b692f69642d67656e657261746f722f762f737461626c65)](https://packagist.org/packages/professional-wiki/id-generator)[![Download count](https://camo.githubusercontent.com/abee81cc93c756418ec4c083d17d78f2e93c2d6e1d37f749863bcf625ddd2909/68747470733a2f2f706f7365722e707567782e6f72672f70726f66657373696f6e616c2d77696b692f69642d67656e657261746f722f646f776e6c6f616473)](https://packagist.org/packages/professional-wiki/id-generator)

modern-timeline

The **ID Generator** extension provides a minimalistic sequential numeric ID generation function. It was created by [Professional.Wiki](https://professional.wiki/).

The wikitext `{{#next_number:}}` outputs `1` the first time it is used, then `2`, etc.

Installable and usable without running the "update.php" maintenance script. Created as an alternative to the IDProvider extension since it cannot be installed via Composer and, moreover, requires an extra database table.

Usage
-----

[](#usage)

To get a new numeric ID:

```
{{#next_number:}}

```

The above function will output a new number on every reparse of the page. If you want a number to be generated once, you can use [MediaWiki's `subst` function](https://www.mediawiki.org/wiki/Help:Substitution) as follows:

```
{{subst:#next_number:}}

```

You can have multiple id sequences by providing an ID type. This type can be any string up to 60 characters.

```
{{#next_number:project}}

```

**Number increment details**

- IDs are incremented globally, not per page.
- Increments happen on every parse.
- MediaWiki might parse the parser function more than once per save, so the function output might go from 1 to 3.
- You are guaranteed to get a higher ID on every generation. Usage is not tracked, so there is no reuse.

**Example**

A page with `{{#next_number:}} {{#next_number:}}` will output `1 2`, assuming the extension was just installed. If the ID counter was already at 100, you'd get `101 102`. If you then refresh this page you'd get `103 104`.

Platform requirements
---------------------

[](#platform-requirements)

- PHP 7.1 or later
- MediaWiki 1.31 or later (and likely also older versions)

Installation
------------

[](#installation)

The recommended way to install ID Generator is using [Composer](https://getcomposer.org) with [MediaWiki's built-in support for Composer](https://professional.wiki/en/articles/installing-mediawiki-extensions-with-composer).

### Step 1

[](#step-1)

Change to the base directory of your MediaWiki installation. If you do not have a "composer.local.json" file yet, create one and add the following content to it:

```
{
	"require": {
		"professional-wiki/id-generator": "~1.0"
	}
}

```

If you already have a "composer.local.json" file add the following line to the end of the "require" section in your file:

```
"professional-wiki/id-generator": "~1.0"

```

Remember to add a comma to the end of the preceding line in this section.

### Step 2

[](#step-2)

Run the following command in your shell:

```
php composer.phar update --no-dev

```

Note if you have Git installed on your system add the `--prefer-source` flag to the above command.

### Step 3

[](#step-3)

Add the following line to the end of your "LocalSettings.php" file:

```
wfLoadExtension( 'IdGenerator' );

```

Contribution and support
------------------------

[](#contribution-and-support)

If you want to contribute work to the project please subscribe to the developers mailing list and have a look at the contribution guideline.

- [File an issue](https://github.com/ProfessionalWiki/IdGenerator/issues)
- [Submit a pull request](https://github.com/ProfessionalWiki/IdGenerator/pulls)
- [Professional MediaWiki support](https://professional.wiki/en/support) is available via [Professional Wiki](https://professional.wiki/).

License
-------

[](#license)

[BSD 3-Clause "New" or "Revised" License (BSD-3-Clause)](/COPYING).

Release notes
-------------

[](#release-notes)

### Version 1.0.0

[](#version-100)

Released on January 27th, 2020.

Initial release

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance49

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2294d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

![](https://avatars.githubusercontent.com/u/1104078?v=4)[Karsten Hoffmeyer](/maintainers/kghbln)[@kghbln](https://github.com/kghbln)

---

Top Contributors

[![translatewiki](https://avatars.githubusercontent.com/u/24829418?v=4)](https://github.com/translatewiki "translatewiki (23 commits)")[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (17 commits)")[![kghbln](https://avatars.githubusercontent.com/u/1104078?v=4)](https://github.com/kghbln "kghbln (4 commits)")

---

Tags

ididgeneratormediawikimediawiki-extensionmediawikiwikiidparser functionid-generatoridgeneratornext\_numbernextnumber

### Embed Badge

![Health badge](/badges/professional-wiki-id-generator/health.svg)

```
[![Health](https://phpackages.com/badges/professional-wiki-id-generator/health.svg)](https://phpackages.com/packages/professional-wiki-id-generator)
```

###  Alternatives

[mediawiki/semantic-media-wiki

An extension to MediaWiki that lets you store and query structured data within wiki pages

586361.8k33](/packages/mediawiki-semantic-media-wiki)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3164.5k](/packages/starcitizentools-citizen-skin)[mediawiki/chameleon-skin

A highly flexible MediaWiki skin using Bootstrap 4

12481.8k2](/packages/mediawiki-chameleon-skin)[mediawiki/semantic-result-formats

Provides additional result formats for queries using Semantic MediaWiki

51180.7k1](/packages/mediawiki-semantic-result-formats)[mediawiki/mermaid

Provides a parser function to generate diagrams and charts with the help of the mermaid script language

4660.9k1](/packages/mediawiki-mermaid)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
