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

Why most of the changes are small

Why an extension written years ago usually needs only small changes for Exponential 6: the extension system, class names and settings stayed, and the changes come from PHP and the browser.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/extension-development/part-4-upgrading/why-most-changes-are-small.md

On this page

Why most of the changes are small

Part 4, chapter 1. This chapter is for anyone who looks at an old extension and wonders whether it is worth the effort. It explains what stayed the same, where the changes come from, and how to estimate the work before you start.

What stayed the same

Exponential 6 is the continuation of the PHP content management kernel that old extensions were written for. The parts an extension plugs into were kept on purpose:

What an extension usesIn Exponential 6
The extension/<name>/ folder with settings/, design/, modules/, classes/, autoloads/, translations/the same layout, read the same way (The extension directory layout)
Activation in site.ini [ExtensionSettings] ActiveExtensions[]the same setting
Class names such as eZContentObject, eZINI, eZDB, eZPersistentObject, eZDataTypethe same names; new kernel code uses an exp prefix, but the old classes were never renamed
module.php with $Module, $ViewList, $FunctionListthe same arrays
Template operators registered through eztemplateautoload.phpthe same $eZTemplateOperatorArray
Datatypes, workflow event types, cronjob parts, fetch functionsthe same base classes and settings
The template language, its operators and the design chainthe same, with operators added

So an extension is rarely "incompatible" as a whole. What breaks is a line here and a line there.

Where the changes come from

Almost every change you will make has one of three causes.

1. PHP itself moved on

Old extensions were written for PHP 5. PHP 8 turned many warnings into errors, removed functions, stopped treating a method named after its class as the constructor, and deprecates a few more things in every minor release. That is the largest group, and it is covered by the PHP chapters of this part, starting with PHP 8 errors that stop old code.

Most of these fixes are a single line. Here is a typical one, from se7enxweb/expsite_api, commit 0f708f4:

// before
public function __construct( eZContentObject $object = null )

// after
public function __construct( ?eZContentObject $object = null )

One question mark. PHP 8.4 reports the old form as deprecated on every request that builds the object.

2. The browser became stricter

Exponential 6 can send a Content Security Policy. A policy without 'unsafe-inline' makes the browser refuse inline <script> blocks, onclick attributes and style="" attributes. An old extension's admin page may look right and still do nothing when you click. The fix is to move code into files, which is covered by the CSP chapters, starting with CSP: moving inline scripts into files.

The JavaScript libraries also moved: YUI 2 and YUI 3 were removed from the administration, and jQuery is version 4. See From YUI to expui and From old jQuery to jQuery 4.

3. The project's conventions

Exponential 6 has conventions an old extension did not know: a version in ezinfo.php and extension.xml that matches the release, a license and a website in both, a composer.json that installs it, admin pages styled with the shared admin4 components instead of private CSS. None of them stops the extension from running; all of them make it easier to install, to trust and to maintain. See Modernizing ezinfo.php and extension.xml.

What the numbers looked like

In October 2026 this project checked every extension it ships against PHP 8.0, the oldest version Exponential 6 supports. Most needed only a version bump and a wider PHP constraint in composer.json; a few needed real fixes. Examples, all on GitHub under se7enxweb:

ExtensionCommitWhat it needed
expchangeclass32196f0nothing in the code: composer.json allows ^8.0, version bumped in three files
expsite_installer0c771feezinfo.php keys quoted (bare words are an error in PHP 8)
expsite_api0f708f4two constructors with a nullable parameter
expquery_translator8ddf68d35 parameters in 27 files made explicitly nullable
sevenx_dseb02ff09utf8_decode() replaced by mb_strlen() in two lines
cjw_tmv0bfa27bcurl_close() and imagedestroy() only on PHP before 8.0
ezfind7ff9824five classes whose only constructor was a method named after the class

The last row is the exception that proves the rule: a change of five methods, but without it search results were empty and the indexing script stopped at once. Small changes are not always unimportant ones.

Estimating the work before you start

Before you promise anyone a date, spend half an hour on an inventory (Taking inventory of an old extension). These signs mean little work:

  • The extension has no PHP of its own (only settings, templates and translations). Templates almost never need changes for PHP 8.
  • Its PHP files pass php -l on PHP 8.0.
  • Its admin pages have no <script> blocks and no on...= attributes.

These signs mean more work:

  • It ships its own copy of a JavaScript library (YUI, an old jQuery, an old TinyMCE plugin).
  • It changes kernel files or ships replacement kernel classes ("kernel overrides").
  • It talks to the database with mysql_* functions instead of eZDB.
  • It uses create_function(), each(), ereg() or split().
  • It depends on a service or library that no longer exists.

Tip

Upgrade in small commits, one kind of change per commit ("constructors", "nullable parameters", "inline scripts"). If something breaks later, git log tells you which kind of change did it, and a reviewer can read each commit in a minute. See Commit messages the project can build a changelog from.

When an upgrade is not worth it

Sometimes the honest answer is no:

  • The kernel now does what the extension did. Use the kernel feature and retire the extension.
  • The extension depends on an external service that shut down.
  • The license does not allow you to change or publish it, and the author cannot be reached.

In those cases, write down what the extension did, find or build a replacement, and say so in your project's notes. Evaluating an old extension has a longer checklist.

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