Port plan: Packagist to Exponential
exp_package_registry is a port of Packagist (MIT) to Exponential, studied at commit 99a280af (2026-11-30). Packagist is a Symfony application on Doctrine, Redis and Algolia. The port keeps what Composer and Packagist clients see (paths, JSON shapes, the update rules) and puts it on what an Exponential installation already has: eZPersistentObject tables on all five databases, the job queue (expqueue), modules and templates, and the administration's design rules.
What maps to what
| Packagist | exp_package_registry |
|---|---|
Entity\Package (name, vendor, repository, type, description, crawledAt, dumpedAtV2, abandoned, replacementPackage, maintainers) | exppkg_package / expPackageRegistryPackage; plus visibility (public or private), credential (for a private repository), dist_mode, state, last_error, readme (Packagist keeps that in PackageReadme) |
Entity\Version (version, normalizedVersion, development, source, dist, composer fields, releasedAt, isDefaultBranch) | exppkg_version / expPackageRegistryVersion: the composer.json at the reference as JSON in data; the dist's file, SHA-1, SHA-256 and signature; blocked, scan_state |
RequireLink, DevRequireLink, ConflictLink ... (one table per link type) | inside data: the registry has no dependents page yet, so the link tables are not needed (wave 3 can add an index table) |
| maintainers (User many-to-many) | exppkg_maintainer (site users, role owner or maintainer) |
Entity\Download + Redis counters | exppkg_download (package, version, day: hits) |
Package\Updater (Composer VCS drivers, VcsRepository) | expPackageRegistryCrawler + expPackageRegistryGit: one bare mirror per package (heads and tags), read with git for-each-ref and git show; any git host, private repositories with a credential |
Package\Updater::applyStableImmutabilityGate | kept: a published stable tag keeps its reference when the tag moves ([Crawler] ImmutableStableTags) |
version normalization (composer/semver VersionParser) | expPackageRegistryVersionParser (a faithful port: tags, numeric branches 1.x-dev, dev-<branch>) |
Package\V2Dumper (packages.json, p2/<name>.json, ~dev.json, minified) | expPackageRegistryMetadata: the same files, minified with composer/metadata-minifier's algorithm, cached in <data>/metadata/p2, served with Last-Modified / 304 |
dists from GitHub/GitLab (api.github.com/.../zipball) | default mode builds the zip here (git archive), SHA-1 for Composer, SHA-256 and an Ed25519 signature; metadata mode keeps the VCS host's zipballs |
Service\UpdaterWorker + Scheduler (Redis queue, cron) | expPackageRegistryQueueHandler (expqueue job types registry.crawl, registry.build, registry.scan) + the scheduler command on a systemd timer |
API: /packages/list.json, /search.json, /packages/<name>.json, /packages/<name>/stats.json, /providers/<name>.json, notify-batch /downloads/ | the same paths and shapes (expPackageRegistryApi, expPackageRegistryServer) |
| search (Algolia) | SQL LIKE over name, description and keywords (good to some thousands of packages; a search index is wave 3+) |
| web front (Twig): home, search, package page, statistics, submit | module registry (list, package, stats, submit) with templates; admin pages in Setup |
| GitHub hooks / API tokens for auto-update | not yet: the timer crawls every [Crawler] Interval; a maintainer can ask for a crawl; push hooks come in wave 3 |
| security advisories, filter lists, transparency log, organizations, 2FA, spam | not ported (Packagist.org's scale problems); advisories are read from Packagist by the composer-audit check |
What is new beside Packagist
- Private packages by license key. A private package's metadata and dists answer only to a license key that
opens it (
exppkg_license_key, Composer http-basic or bearer). The source is a private git repository the registry reads with a credential; the zips are built here and served only through that auth. - Signed dists. Every zip has an Ed25519 signature over
exp-dist-v1:<sha256>:<package>:<version>:<reference>; the metadata carries it asdist-signature, the public key is at/keys/registry.pub. - Three modes. composer (default), metadata (dists from the VCS host) and api (REST and GraphQL only).
- REST and GraphQL beside Packagist's API, with checksums, signatures and the results of the checks.
- A CI hook per release (doc/ci.md): php -l on each PHP version, composer audit, encoded code, license and docs, the kernel's design rules and API rules, phpcs and phpstan; failures that block keep the release out of the metadata. Runners are pluggable; the cluster runner is an interface with a stub in this wave.
Order of work (wave 2)
- Tables and schema files for the five engines (expqueue's schema pattern).
- Git access, version parser, crawler, dist builder and signer.
- Composer v2 metadata and the HTTP endpoints; license key auth.
- Packagist, REST and GraphQL APIs.
- Queue handler and the scheduler with its systemd timer.
- CI hook and the local runner; cluster runner interface.
- Web front and admin pages, styling tests.
- Proof on a tmpfs test site: submit a se7enxweb package, crawl it,
composer requireit in a throwaway project, a private package refused without a key and served with one.