Part 4: Upgrading an old extension to Exponential 6
This is the fourth part of Extension development: the book. It is for anyone who has an extension that was written for an older release and an older PHP: one you found on GitHub, one your team wrote ten years ago, or one you adopted. Exponential 6 keeps the extension system the old extensions were written for, so most of them need only small changes. This part shows which ones, in the order you meet them, and every example of a change is a real commit from an extension this project brought up to date (the repository and the short commit hash are named next to it, so you can read the whole change on GitHub).
How this part is organized
The short version
If you read only one page of this part, read The upgrade checklist. If you want to start right away:
- Copy the extension into
extension/of a development installation (never a live site first). - Run
php -lon every PHP file with the oldest PHP you want to support (8.0 is the oldest Exponential 6 supports; 7.4 is usable without support). - Activate it, open its pages with the debug output on, and write down every error, warning and "Deprecated" line that names one of its files.
- Fix those, one kind at a time, with the chapters of this part.
- Open the browser console on its pages and fix what the Content Security Policy blocks.
- Give
ezinfo.php,extension.xmlandcomposer.jsonthe current version, license and website. - Add a test that keeps it that way.
Note
You may only upgrade, publish and share an extension the way its license allows. Read Reading licenses before you reuse anything before you change an extension someone else wrote, and keep their copyright notices.
What you need before you start
| You need | Why | Where it is explained |
|---|---|---|
| A development installation of Exponential 6 | you will break things on purpose | Tools you need |
| Git | to see every change you make and undo it | Develop with Git |
| The debug output | to see warnings and deprecations | Debug output and logs for developers |
| A browser with developer tools | to see what the Content Security Policy blocks | Content Security Policy for extensions |
| Part 3 of this book, at least the anatomy | you need to know where things live | Part 3 |
Related pages
- Previous: Part 3: The extension developer
- Next: Why most of the changes are small
- PHP 8 support and PHP 8.0 support
- Behavior changes for extensions
- Extension development: the book
- 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.