...
Keeping your system up to date is important to make sure your system is running optimally and securely. The update system in eZ Publish Platform is using the de-facto standard PHP packaging systems called Composer for this. This makes it easy to adapt package installs and updates to your workflow, allowing you to test updates new/updated packages in development environment, put the changes in your version control system (GIT, ...), pull in those changes on staging environment and when approved put it in production.
Prerequisite to using composer
Setting up Authentication tokens for access to commercial updates
Out of the box composer uses a packaging system called packagist.org for all open source packages and their updates, in eZ Publish Platform additional commercial updates are packages are available at updates.ez.no/bul/ (password protected, you'll need to setup authentication tokens to authentication tokens as described below to get access).
To get access to these updates go to your service portal on support.ez.no, your project will need to be configured for eZ Publish Platform 5.3 or higher and you will have access to the following on the "Maintenance and Support agreement details" screen:
...
For login to get updates, use your Installation key found higher up on the same page, and the password you retrieved and saved in step 3.
Optional: Save authentication token in auth.json to avoid repeatedly typing
To avoid having to always type your credentials, bunded with eZ Publish Platform is a composer extension which makes it possible to put this in a auth.json file.
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "config": { "basic-auth": { "updates.ez.no": { "username": "<installation-key>", "password": "<password>" } } } } |
Installing Composer
This step is only needed once per machine (per project by default, but globally on machine also possible, for alternatives see: https://getcomposer.org/download/).
Composer is a command line tool, so main way to install it is via command-line, example with only requirement on php being installed:
Code Block | ||||
---|---|---|---|---|
| ||||
php -r "readfile('https://getcomposer.org/installer');" | php |
...
Using composer
...
# Running composer update and version changes
Updating eZ Publish Platform via composer is nothing different then updating other projects via composer, but for illustration here is how you update your project locally:
...
Tip2: In large development teams make sure people don't blindly update and install third party components, this might easily lead to version conflicts on this composer.lock file and can be tiring to fix-up if happening frequently. A workflow involving composer install and unit test execution on proposed changes can help avoid most of this, like available via Github/Bitbucket Pull Request workflow.
...
# Installing versioned updates on other development machines and/or staging
Again, installing Installing eZ Publish Platform packages via composer is nothing different then installing vanilla packages via composer, but for illustration here is how you install versioned updates:
...
Tip: Here the importance of composer.lock comes in as this command will tell composer to install packages in exactly same version as defined in composer.lock. If you don't keep track of composer.lock it will instead just install always latests version of a package, hence not allow you to stage updates before moving it towards production.
# Installing eZ packages via composer
Also requiring eZ Publish Platform packages via composer is nothing different then requiring vanilla packages via composer, but for illustration here is how you install a eZ package:
Code Block | ||
---|---|---|
| ||
php -d memory_limit=-1 composer.phar require --prefer-dist ezsystems/ezfind-ls:5.3.* |
That is it, for more specific instructions see release notes provided for all updates as they will suggest more specific ways to get the known eZ updates.