3.2 Extension Meta Information

PivotX searches through the pivotx/extensions/ folder, automatically adding all extensions it finds to the admin-screens for Extensions and Widgets, where you can enable or disable them.

These screens also display certain information about the extensions it has found. It does this by reading the Meta Information that should come with every extension. Every extension ought to have at least one 'entry point', the name of which should be snippet_extensionname.php, hook_extensionname.php, widget_extensionname.php or admin_extensionname.php, where 'extensionname' should be the name of the extension.

When PivotX indexes the pivotx/extensions/ folder, all files with matching filenames will be added to the internal list of available extensions, and they will be read to parse and display the meta-information in these files. This meta information is actually nothing more than a PHP comment block with a specific format. For example, the meta information in mobile/snippet_mobile.php looks like this:

// - Extension: Mobile Browser Extension  
// - Version: 0.5  
// - Author: PivotX Team  
// - Email: admin@pivotx.net  
// - Site: http://www.pivotx.net  
// - Description: A snippet extension to detect mobile browsers, and ...  
// - Date: 2009-02-22  
// - Identifier: mobile  
// - Required PivotX version: 2.1.0  

Every line with meta information looks like this:

// - [Key]: [Value]

Where 'Key' is one of a certain set of predefined keys which can contain information. The 'value' is the value of the preceding key, and the possible values depend on the type of the key. One fixed limitation is that a value must always be on one line, immediately following the key.

Some of the key/value pairs are required. If they're missing, your extension won't work, or it won't be accepted in the Extensions gallery on extensions.pivotx.net. Some other key/value pairs are optional, and some others still are required under certain conditions (like the 'Required database' key).

The required keys are:

The optional keys are:

You can use other keys, but they will be ignored by PivotX. They won't break anything either, though.