start.php and manifest.xml files

Every plugin requires a start.php and a manifest.xml file.

start.php
Every plugin requires start.php file even if the file is empty and it must be located inside the root directory of the plugin. start.php contains code which is loaded into the Elgg engine. It can be used to:

  • register plugin's init function to the system by calling register_elgg_event_handler()
  • register actions
  • register page handlers
  • extend views
  • register CSS or JS files
  • add menu entries
  • include libraries required by the plugin

Note that start.php is only called for active plugins.

manfest.xml
manifest.xml describes a plugin. Following is explanation for Elgg 1.7. The format of manifest.xml has changed for Elgg 1.8 and it is not covered here. It uses xml tag attributes to describe author, version, description, website, copyright, license, and elgg version for the plugin. For example:

<?xml version="1.0" encoding="UTF-8"?>
<plugin_manifest>
    <field key="author" value="Nazim" />
    <field key="version" value="1.0" />
    <field key="description" value="Snazzy theme" />
    <field key="website" value="http://molecularsciences.org" />
    <field key="copyright" value="molecularsciences.org" />
    <field key="licence" value="GNU" />
    <field key="elgg_version" value="2011030101" />
</plugin_manifest>

elgg_version has the format YYYYMMDDVV, where YYYY is the 4 digit year, MM is the two digit month, DD is the two digit day, and VV are version numbers assigned by the developer.

Converting to Elgg 1.8
At the time of this writing, Elgg 1.8 is still not stable. Since it is plugin based system, you probably wouldn't want to move to Elgg 1.8 before the most important plugins are migrated. This means about a window of 6 - 12 months. Once Elgg 1.8 and most major plugins are ready for production, you would need to migrate your site to Elgg 1.8. To upgrade manifest.xml to 1.8, you would need to do the following. Change

<field key="author" value="Nazim" />

to

<author>"Nazim"<author>