Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
     Glossary
   eZ Publish 4.x / legacy

 
eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: typos and formatting

...

Keeping your system up-to-date is important, to make sure your it is running optimally and securely. The update mechanism in eZ Publish Platform is using the de facto standard PHP packaging system called Composer for this. This makes it easy to adapt package installs and updates to your workflow, allowing you to test new/updated packages in a development environment, put the changes in your version control system (GITgit, Subversion, Mercurial, etc.), pull in those changes on a staging environment and, when approved, put it in production.

...

  1. Click "Create token"
  2. Fill in a label describing the use of the token
    • Example, if you need to provide access to updates to a third party a good to example would be "53-upgrade-project-by-partner-x", this will allow you to revoke access later.
  3. Copy the password, you will not get access to this again!

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 fill your credentials, bunded bundled with eZ Publish Platform is a composer Composer extension which makes it possible to put this informations in a auth.json file.

Short: Add an auth.json file at your project root, aside composer.json, or in your COMPOSER_HOME directory for machine wide use, the file looks like the following:

...

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 the main way to install it is via command-line, example with only requirement on php PHP being installed:

Code Block
languagebash
titlecomposer download in current folder:
php -r "readfile('https://getcomposer.org/installer');" | php

...

Code Block
languagebash
titlecomposer update
php -d memory_limit=-1 composer.phar update --no-dev --prefer-dist
Info
titleTip
Tip: This will load in all updated packages, from eZ as well as third party libraries both used by eZ and others you may have added. So when updating like this it is recommended to take note of what was updated so you have an idea of what you should test before putting the updates into production.

 

When this has completed, make sure to version (assuming you use a version control system) changes done to "to composer.lock" file, this . This is the file that contains all details of which versions are currently used and makes sure the same version is used among all developers, staging and eventually production when current changes are approved for production (assuming you have a workflow for this).

 

Info
titleTip
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 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

Installing eZ Publish Platform packages via composer Composer is nothing different then installing vanilla packages via composerComposer, but and for illustration here is how you install versioned updates:

Code Block
titlecomposer install (package installation)
php -d memory_limit=-1 composer.phar install --no-dev --prefer-dist
Info
titleTip
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 composerComposer, but and for illustration here is how you install a eZ package:

...

(eZ Publish) Legacy by design places all important customizable folders within it's own structure. This is not ideal with composer Composer, as installation and updates might cause them to become as provided by packages again.
To make sure you are safe from this, and to allow you to version these custom folders independently, it is recommended that you use symlinks and keep your custom settings, extensions and design outside of the ezpublish_legacy folder. To not have to manually deal with these symlinks it is recommended to use Composer post-install-cmd and post-update-command script commands to make this automated.

...