Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,199 of 9,199 pages
About the help in other languages
All help pages

Composer and Packagist

Register an extension on Packagist so sites can install it with composer require - the composer.json it needs, submitting the repository, how versions come from tags, and how users install and update it.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/extension-development/part-7-releasing/composer-and-packagist.md

On this page

Composer and Packagist

Part 7, chapter 5. Packagist is the public index Composer looks in. Once your extension is registered there, a site installs it with one command, and gets your updates with another. This chapter registers an extension and shows what users then do.

Before you submit

  • The repository is public on GitHub (or another host Packagist can read).
  • composer.json is valid and complete (composer.json for an extension): name, description, type ezpublish-legacy-extension, license, require with php and an installer, and extra.ezpublish-legacy-extension-name.
  • composer validate passes.
  • There is at least one tag (Choosing the next version number).
composer validate

Submit

  1. Sign in on packagist.org (with your GitHub account is easiest).
  2. Click Submit.
  3. Paste the repository's address, for example https://github.com/your-account/myext.
  4. Packagist reads composer.json, shows the package name, and creates the package page https://packagist.org/packages/your-account/myext.

The package name comes from composer.json, not from the repository name. It must be free on Packagist, and it belongs to whoever registered it first, which is why a fork uses its own vendor name.

Where versions come from

Packagist creates one version per tag (v1.2.4 becomes 1.2.4) and one development version per branch (main becomes dev-main). It reads them when it is told the repository changed: through the GitHub integration, which you should check after the first submit (The Packagist webhook).

A version field in composer.json is not needed and, if present, must match each tag exactly, so most extensions leave it out.

What users do

composer require your-account/myext:^1.2

Composer finds the package, checks that its requirements fit the site (PHP version, other packages), downloads it, and the legacy installer plugin puts it into extension/myext/ (the name from extra.ezpublish-legacy-extension-name). Then the user activates it and clears the caches, as your README says.

Later:

composer update your-account/myext

takes the newest version their constraint allows (Versioning rules).

Requirements that protect users

What you put in require decides where your extension can be installed:

RequirementEffect
"php": "^8.0"Composer refuses to install on PHP 7
"se7enxweb/exponential": "^6.0.14"refuses to install with an older kernel (use it when you call APIs that came with that release)
"ext-mbstring": "*"refuses when the PHP extension is missing, instead of a fatal error later
another extension with a version rangeinstalls it too, or refuses on a conflict

Require what you really need, and no more: every requirement is a reason Composer may refuse.

Updating the package information

The package page updates itself when the webhook works. If it does not, the package page has an Update button for maintainers; use it once, then fix the webhook.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x