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

ezinfo.php: who made it and which version

The ezinfo.php metadata file - class name, the static info() method, the keys the administration reads, how it is read after extension.xml, the PHP 8 bare-key trap with a real fix, and how to check it.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/extension-development/part-3-extension-developer/ezinfo-php.md

On this page

ezinfo.php: who made it and which version

Part 3, chapter 2. ezinfo.php tells the system and its users what an extension is: its name, version, copyright, license and website. Setup > About, Setup > Extensions and the upgrade checks read it. The reference is Extension metadata; this chapter shows how to write one and the mistakes to avoid.

The file

extension/mysite_hello/ezinfo.php:

<?php
class mysite_helloInfo
{
    public static function info()
    {
        return array(
            'Name'      => "My Site Hello",
            'Version'   => "1.0.0",
            'Copyright' => "Copyright (C) 2026 Your Organization",
            'License'   => "GNU General Public License v2.0 (or any later version)",
            'Info_url'  => "https://github.com/your-organization/mysite_hello"
        );
    }
}
RuleWhy
The class is the folder name plus Info: mysite_helloInfothat is the name the reader looks for
info() is public staticit is called statically
Keys are quoted stringsa bare Name is a constant lookup, an error in PHP 8 (below)
Name is a readable namethe about page shows it; a folder name looks broken there
Version has no vthe release tag v1.0.0 gives 'Version' => "1.0.0"
License is the full namefor example GNU General Public License v2.0 (or any later version)
Info_url is the project pageshown as the extension's website

Keys are matched case-insensitively, so older extensions that write info_url still work; new ones write Info_url.

Who reads it, and in which order

The reader is expInfo (lib/ezutils/classes/expinfo.php): expInfo::extensionInfo( 'mysite_hello' ) returns the normalized fields name, description, summary, version, copyright, author, license and info_url. It reads:

  1. extension.xml first; non-empty values win,
  2. then ezinfo.php, for every field extension.xml did not give,
  3. then composer.json and the Git origin, for what is still missing.

So both files should exist and agree. A quick check with the kernel loaded:

<?php
// php bin/php/ezexec.php extension/mysite_hello/scripts/info.php
$info = expInfo::extensionInfo( 'mysite_hello' );
eZCLI::instance()->output( $info === false ? 'not found' : $info['name'] . ' ' . $info['version'] );

The PHP 8 trap: bare keys

Older extensions wrote the keys without quotes. In PHP 5 an undefined constant became its own name with a notice; in PHP 8 it is an Error, and the page that reads the metadata stops. A real fix, from se7enxweb/expsite_installer (commit 0c771fe, "Fixed ezinfo.php, whose keys were bare words that PHP 8 reads as undefined constants and stops on"):

// before
return array( Name => "expsite_installer",
              Version => "1.0.1",
              info_url => "https://github.com/se7enxweb/expsite_installer" );

// after
return array( 'Name' => "expsite_installer",
              'Version' => "1.0.1",
              'Info_url' => "https://github.com/se7enxweb/expsite_installer" );

php -l does not catch this (the file is valid syntax); only running it does. Part 4 has more of these: Modernizing ezinfo.php and extension.xml.

HTML in the values

Some older extensions put HTML links into Name or Copyright (<a href='...'>). expInfo removes the tags (strip_tags()) when it normalizes the fields, so only the text is shown and the link is lost. Write plain text and use Info_url for the link.

Keep every earlier holder when you take over or fork an extension, and add yourself:

'Copyright' => "Copyright (C) 2011 - 2014 Original Author Organization, 2026 Your Organization",

See Attribution and copyright notices.

Check

php -l extension/mysite_hello/ezinfo.php
php bin/php/ezexec.php extension/mysite_hello/scripts/info.php

Then open Setup > Extensions: the card shows your name, version, license and website.

At every release

The Version in ezinfo.php and in extension.xml equals the release version, changed in the commit the tag points at; see Bumping ezinfo.php and extension.xml.

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.

Since 29 October 2026 the copyright of Exponential is held by the Exponential Foundation and 7x together, the Foundation named first: "Exponential Copyright © 1998-2026 Exponential Foundation and 7x", in files "Copyright (C) 1998 - 2026 Exponential Foundation and 7x. All rights reserved." Who holds it and why, what the GPL lets you do, the third-party notices that stay and how to write the notice in new files and extensions: Copyright and copyleft.

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