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

Creating packages with ezpm

Build the packages your site package requires from a shell with ezpm.php - create, add classes, content or an extension, set the vendor and other fields, export, validate and check - in a form you can script and run…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/site-packages/your-own/creating-packages-with-ezpm.md

On this page

Creating packages with ezpm

This page is for developers and hosts who prefer a script to the browser. ezpm.php in the installation root (also php bin/php/console ezpm) is the command line package manager; it makes the same class, content and extension packages as the package wizard, and because it is a command, the export of your demo content can be repeated for every release with the same options.

7x and the Exponential Foundation strongly encourage you to submit the finished site package by pull request to se7enxweb/exponential.packages.exponential.earth: see Contribute your site package.

Contents

  1. The commands you need
  2. A classes package
  3. A content package
  4. An extension package
  5. Setting fields
  6. Export, validate, check
  7. A release script

The commands you need

From php ezpm.php help and kernel/private/classes/commands/ezpm.php:

CommandUsageDoes
createcreate NAME [SUMMARY [VERSION [INSTALLTYPE]]]a new, empty package; INSTALLTYPE is install (default) or import
addadd PACKAGE ITEM [ITEMPARAMETERS]...adds ezcontentclass, ezcontentobject (alias ezcontentsubtree), group, and items of other handlers such as ezextension
setset PACKAGE ATTRIBUTE ATTRIBUTEVALUEsummary, description, vendor, priority, type, extension, source, version, licence, state
exportexport PACKAGE [-d DIRECTORY] [--format=xml|json]writes the .ezpkg archive
validatevalidate SOURCEchecks an archive, a directory or a package name without importing
checkcheck PACKAGE [--all]what installing would meet here, by remote ID; writes nothing
list, infolist, info PACKAGEthe packages of the repositories, one package's details

Global options include -s/--siteaccess, -l/--login with -p/--password and -r/--repos; the full table is on ezpm: the package manager on the command line.

Warning

Run ezpm on a test installation. install and import change the installation; create, add, set and export only write packages, but add of content reads the whole subtree and can take a while.

A classes package

php ezpm.php create acme_classes 'Acme content classes' 1.0.0 install
php ezpm.php add acme_classes ezcontentclass article,folder,acme_product
php ezpm.php set acme_classes vendor acme
php ezpm.php set acme_classes type contentclass
php ezpm.php export acme_classes -d var/tmp

add ezcontentclass takes one argument: class IDs or identifiers, separated by commas. An unknown one stops the command with "Content class with identifier ... does not exist".

A content package

php ezpm.php create acme_site_democontent 'Acme demo content' 1.0.0 install
php ezpm.php add acme_site_democontent ezcontentsubtree /content/demo \
    --exclude-classes --exclude-templates --language=eng-US,ger-DE
php ezpm.php set acme_site_democontent vendor acme
php ezpm.php set acme_site_democontent type contentobject
php ezpm.php export acme_site_democontent -d var/tmp

The starting point is a node ID or a URL path; everything below it is included. The options of add ezcontentobject: --include-classes/--exclude-classes, --include-templates/--exclude-templates, --node-main/--node-selected, --siteaccess=sa,sa2, --language=loc1,loc2, --current-version/--all-versions, --minimal-template-set. Leave the classes out when your classes package carries them, so they are defined in one place.

An extension package

bin/repack_extension.sh in the 7x source repository shows the sequence the 7x team used for an extension package:

php ezpm.php create acme_extension 'Acme extension' '1.0.0' 'install'
php ezpm.php add acme_extension ezextension acme
php ezpm.php set acme_extension vendor acme
php ezpm.php set acme_extension type extension
php ezpm.php set acme_extension state stable

Exporting an extension is off by default: add ezextension refuses until the extension is listed in package.ini [ExtensionExportSettings] AllowedExtensions[] (or *), and it always refuses an extension that holds secret values or key material (Exporting with ezpm).

Setting fields

set changes one field of the package definition and, like add and delete, "will open up a new release if no open releases exists yet" (the command's help). create starts every package with release 1, the license GPL, the state alpha, no vendor and the logged-in user (if any) as maintainer. Set at least:

AttributeExampleWhy
vendoracmethe repository directory the package is imported into
typecontentclass, contentobject, extensionthe type the index and the policies use
licenceGPL-2.0-or-laterthe license the package page shows (License and documents)
statestableone of package.ini [PackageSettings] StateList[]

Export, validate, check

php ezpm.php export acme_classes -d var/tmp                 # classic format
php ezpm.php export acme_classes -d var/tmp --format=json   # JSON format, .json.ezpkg
php ezpm.php validate var/tmp/acme_classes-1.0.0-1.ezpkg
php ezpm.php check acme_site_democontent --all

export names the archive <name>-<version>-<release>.ezpkg (eZPackage::exportName()). A package server and an index.xml usually use <name>.ezpkg, the name build.sh gives: unpack the export into packages/<name>/ of your source repository and let build.sh make the published archive, so every package of a release is built the same way (Rebuilding with build.sh). The two formats are explained on Classic and JSON packages.

A release script

Keep the commands in your source repository so the next release repeats them exactly:

#!/usr/bin/env bash
set -euo pipefail
cd /path/to/test-installation
php ezpm.php create acme_site_democontent 'Acme demo content' "$1" install
php ezpm.php add acme_site_democontent ezcontentsubtree /content/demo --exclude-classes
php ezpm.php set acme_site_democontent vendor acme
php ezpm.php export acme_site_democontent -d "$HOME/acme-build"

Run it for a package name that is not in the test installation's repositories yet (php ezpm.php list shows them), so each run starts from an empty package.

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