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

expInfo class and expinfo operator

Read this page if you want to read installation or extension metadata from PHP or from a template, or if you maintain an override of the Setup > Extensions view. 6.0.15 adds expInfo, a read-only PHP class, and the…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/bc/6.0/expinfo-operator.md

On this page

expInfo class and expinfo operator

Read this page if you want to read installation or extension metadata from PHP or from a template, or if you maintain an override of the Setup > Extensions view. 6.0.15 adds expInfo, a read-only PHP class, and the matching expinfo template operator. Nothing existing changes behaviour; the Setup > Extensions view now uses the new class internally.

In short

What changedNew class expInfo (lib/ezutils/classes/expinfo.php) and template operator expinfo.
Who is affectedTemplate and extension authors who want the data; overrides of Setup > Extensions.
How to checkPut {expinfo( 'no_such_ext' )|attribute( show )} in a scratch template; it shows false.
How to fixNothing to fix. Regenerate autoloads, clear caches and reload PHP-FPM after deploying (see "Deploy").

PHP API

lib/ezutils/classes/expinfo.php declares expInfo with these static methods:

MethodReturns
expInfo::activeExtensions()Metadata of all active extensions, keyed by extension directory name.
expInfo::availableExtensions()Metadata of every extension found on disk, each with an active boolean.
expInfo::extensionInfo( $name, $activeOnly = false )Metadata of one extension, or false when it is not found (or, with $activeOnly, not active).
expInfo::hasActiveExtension( $name )true or false.
expInfo::activeNames()The list of active extension names.
expInfo::kernelInfo( $section = false )A large read-only array describing the installation. With a section name (see the table below) only that section. Built once per request and kept in memory.

An extension's metadata array holds the keys Name, Version, Copyright, License, info_url, description, author, summary, meta, mtime and active, and more: the exact list is whatever the extension's ezinfo.php or extension.xml provides, normalised.

Template operator

lib/eztemplate/classes/eztemplateexpinfooperator.php registers expinfo:

{expinfo()}                     {* active extensions array *}
{expinfo('all')}                {* all available extensions array *}
{expinfo('bcwebshop')}          {* single extension info array *}
{expinfo('kernel')}             {* the whole kernel info array; a single section is a PHP call, see above *}

Kernel info sections

expinfo('kernel') and expInfo::kernelInfo() return these thirteen top-level sections:

SectionContents
versionExponentialSDK version, state, alias, edition (lib/version.php)
phpPHP version, SAPI, loaded extensions, INI limits
memoryCurrent and peak memory usage
serverHost name, kernel/var/cache/www paths, server software
databaseDatabase type, version, name, server, user (password redacted)
iniSite name, siteaccess, designs, languages, database settings
userCurrent user id and login, if available
extensionsActive and available extension counts and name lists
cacheCache directory size and compiled template count
filesystemRoot, var and extension directory sizes; disk free and total
timestampsmtime of lib/version.php, index.php, composer.lock and others
gitBranch, last commit hash and date, dirty file count
composerInstalled Composer package count and versions

Security

  • Database and INI passwords are always returned as ***.
  • No secrets, private keys or credentials are exposed.

Check it yourself

  • In a template: put {expinfo( 'no_such_ext' )|attribute( show )} in a scratch template and view it. The result is false.
  • From PHP: call the class from a script run with php bin/php/ezexec.php <script> --allow-root-user. expInfo::kernelInfo() returns exactly the thirteen sections above, and expInfo::extensionInfo( 'no_such_ext' ) returns false.

Setup > Extensions

The Setup > Extensions view (entry point kernel/setup/extensions.php, code in kernel/private/classes/views/setup/extensions.php) now collects extension metadata with expInfo::availableExtensions() instead of an inline helper. An override of that view can call the same method.

Deploy

php bin/php/ezpgenerateautoloads.php -e
php bin/php/ezcache.php --clear-all --allow-root-user

Then reload the PHP-FPM that serves the site, so the web runtime picks up the new class.

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