Composer and Git on servers
This page is for system administrators and support staff at a hosting company who install and update Exponential sites, and for product managers deciding whether customers get shell access with Composer and Git. It answers: how the code arrives, what Composer does that a plain copy does not, which install way fits which kind of plan, and which commands are dangerous on a live site. The source is chapter 3 of the installation book, Getting the code.
Contents
- Why Composer is part of the platform
- What a host provides
- Three ways to get the code
- Versions and tags
- Extensions are packages
- Updating safely
- Updates from the administration
- Checklist
- Related pages
Why Composer is part of the platform
Exponential installs with Composer 2. Composer downloads the kernel's libraries (the
expcomponents, se7enxweb/expcomponents-*, the fork of the Zeta Components), every
extension composer.json requires and, when asked, Velocity. Without it, vendor/ is missing and the site cannot
start. After composer install, the script legacy-scripts runs php bin/php/ezpgenerateautoloads.php, which
generates the class maps (chapter 2.7).
What a host provides
| Item | Why |
|---|---|
| Composer 2, current | composer.json lists the installer plugin under config.allow-plugins, which Composer reads from 2.2 on |
| The site's PHP as Composer's PHP | Composer checks php and ext-* against the PHP it runs with; a newer command line PHP picks versions the web PHP cannot run |
| Outbound HTTPS from the server | Composer fetches from Packagist and GitHub |
| Git | for the recommended clone-based way, and for updates of clones |
| Disk for history | a kernel clone with its whole history is about 370 MB; extension clones add to it |
On servers with several PHP versions, run Composer with the site's PHP, for example
/opt/plesk/php/8.5/bin/php /usr/local/bin/composer install (adjust both paths to your server).
Three ways to get the code
From chapter 3.2:
| Way | Gives | Fits |
|---|---|---|
A. git clone and composer install (recommended) | the kernel and every se7enxweb extension as Git clones with full history | customers who build and change sites; development and staging; managed sites a host maintains with Git |
B. composer create-project se7enxweb/exponential | release archives without history | sites that are only run, quick evaluations, simple provisioning |
C. composer require se7enxweb/exponential into an empty directory | the kernel as a package of the customer's own project | installations managed as a project of their own |
For way A, tell Composer once per user account to install se7enxweb/* packages as clones:
composer config --global 'preferred-install.se7enxweb/*' source
git clone https://github.com/se7enxweb/exponential.git
cd exponential
composer installFor way B on a production server, add --no-dev, which leaves out the test tools:
composer create-project se7enxweb/exponential:v6.0.14 exponential --no-devNote
On PHP 8.0, no published tag installs: the tags v6.0.8 to v6.0.14 require PHP 8.1. Take the 6.0.15 line
(dev-main) until its tag is published. The tags v6.0.13 and v6.0.14 also need extra steps on PHP 8.1 to 8.3
because of their PHPUnit requirement (chapter 3.3).
Versions and tags
Exponential is published as the Composer package
se7enxweb/exponentialfrom github.com/se7enxweb/exponential. Release tags arev6.0.0and later in the 6.0 line;maincarries the current development.A release tag never changes. A fix always arrives as the next version, so a pinned version gives the same files every time: the right choice for production.
Sort versions by version, never by name: by name
v6.0.10sorts beforev6.0.8.git tag -l 'v*' --sort=version:refname | tail -5
Extensions are packages
Every extension except the four shipped in the kernel repository (ezjscore, ezoe, ezformtoken,
expservices) is a Composer package that the installer plugin places in extension/<name>. So composer.json
decides which extensions an installation has and their versions
(chapter 3.5).
Adding one is three steps:
composer require se7enxweb/ezfind
php bin/php/ezpgenerateautoloads.php -e
php bin/php/ezcache.php --clear-tag=iniand activating it in [ExtensionSettings] ActiveExtensions[] (in the administration under Setup > Extensions, or
in settings/override/site.ini.append.php); restart Velocity if it serves the site.
The suggest block of composer.json lists optional extensions a host may want to offer as add-ons, among them
ezfind (Solr search), sevenx_valkey_cache (cache on Valkey or Redis), ezscriptmonitor and hcaptcha.
Updating safely
Warning
Do not run composer update casually on a live site. It moves every package to the newest version its constraint
allows. Update one package deliberately (composer update se7enxweb/<package>) and read its release notes first.
- Clones that Composer made itself are safe: Composer refuses to update a clone with uncommitted changes or unpushed commits (When Composer refuses).
- A clone made by hand in place of a package Composer installed as an archive is not safe: Composer still treats
the folder as an archive and replaces it, history and commits included. Use
composer reinstall <package>after settingpreferred-installinstead. - Moving the code is half of an upgrade; the database update files are the other half (chapter 11).
- Back up before every update (What to back up).
A safe update of a clone-based site:
git fetch origin --tags
git merge v6.0.<n> # or origin/main
composer installUpdates from the administration
The ezupdate extension, required by composer.json, is a package manager in the administration (Setup >
Updates and packages) and on the command line. Updating and installing are off until switched on in
settings/override/ezupdate.ini.append.php ([UpdateSettings] AllowUpdate, AllowInstall), because Composer
rewrites vendor/ and every package it manages (ezupdate).
For a host this is a policy decision per plan: leave it off where the host manages updates, or switch it on for customers who manage their own. See Automated updates with ezupdate.
Checklist
- To do: Composer 2, current, available to the site's user.
- To do: Composer runs with the site's PHP version.
- To do: Outbound HTTPS to Packagist and GitHub allowed.
- To do: Production installs use
--no-dev. - To do: Customer sites pinned to release tags unless they follow
mainon purpose. - To do: No casual
composer updateon live sites; a backup before every update. - To do: A policy per plan for
ezupdate'sAllowUpdateandAllowInstall.
Related pages
- Chapter 3: Getting the code
- Develop with Git
- Upgrading customer sites and Deploying changes
- Extensions guide
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
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.