Path / documentation / ez publish / upgrading / upgrading to 4.0 / important notes

Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

Important notes

This section contains important notes about upgrading your existing eZ Publish 3.x installation to version 4.0. Read it carefully before you do the actual upgrade.

Upgrade path, requirements and preparation

eZ Publish 4.0 contains all the functionality of the 3.10 series. Before upgrading, check the requirements and set up the hosting environment for your site accordingly, so that you can quickly switch to PHP 5 after upgrading the distribution files.

It is not possible to upgrade directly from version 3.9 (and earlier) to 4.0, and the 4.0 distribution does not contain upgrade scripts for this. Instead, you should upgrade to 3.10.1 first, and then upgrade from 3.10.1 to 4.0.1.

Compatibility with extensions

Extensions compatible with eZ Publish 3.x may not work with 4.0. The following table shows which versions of the different extensions are supposed to work with eZ Publish 4.


Compatibility with 4.0

Website Interface


Online Editor

v.4.3 (comes together with eZ Publish 4.0)

ODF Import / Export

v.2.1 (comes together with eZ Publish 4.0)

eZ PayPal Payment Gateway

v.1.1 (upcoming)

eZ Publish Extension for Oracle® Database


eZ Find


eZ Newsletter

v.1.6 (upcoming)

Paynet Direct

Not tested for compatibility yet.

Paynet Terminal

Not tested for compatibility yet.

Custom extensions developed for eZ Publish 3.x may stop working after upgrading to 4.0, especially those using constants of the eZ Publish kernel. These have been moved inside class definitions. The following examples show the difference based on the code taken from "kernel/classes/ezcontentobject.php":





class eZContentObject extends eZPersistentObject
 const STATUS_DRAFT = 0;


The following line shows an example of using these constants in PHP code for eZ Publish 3.x.


In 4.0, this constant does not exist anymore (it has been renamed and moved inside the class definition) and you will have to use the new class constant instead:

$status = eZContentObject::STATUS_DRAFT;

Refer to the PHP documentation for more information about class constants.

Notes for extension developers

When developing custom extensions for eZ Publish 4, keep in mind that it stores each class definition in a separate PHP source file and makes use of the __autoload() function instead of having a list of needed includes at the beginning of each source file. All class definitions of the eZ Publish kernel have their paths listed in the "autoload/ezp_kernel.php" file. The "autoload/ezp_extension.php" file contains an array of paths for class definitions that are a part of the extensions that come with eZ Publish. This array must be updated every time you add a new extension to the system. This can be done by running the "ezpgenerateautoloads.php" script located in the "bin/php" directory. The following example shows how to run the script.

  1. Navigate into the eZ Publish 4.0 directory.
  2. Run the script using the following shell command:
    php bin/php/ezpgenerateautoloads.php --extension

The script will look for class definitions in the "extension" directory and update the "autoload/ezp_extension.php" file accordingly. You can instruct the script to skip some of the extension subdirectories by using the optional "--exclude" parameter. To do this, run the script using the following shell command (replace "ext1" and "ext2" with the actual names of the extension subdirectories):

php bin/php/ezpgenerateautoloads.php --extension --exclude="extension/ext1 extension/ext2"


Note that it is also possible to update the "autoload/ezp_extension.php" file by clicking the "Regenerate autoload arrays for extensions" button located in the "Setup - Extensions" part of the administration interface. In this case, only class definitions that are a part of globally enabled/activated extensions will be listed in the updated file.

Svitlana Shatokhina (23/05/2008 11:13 am)

Gaetano Giunta (19/05/2009 2:57 pm)

Svitlana Shatokhina, Gaetano Giunta