Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

version.php: Difference between revisions

From MoodleDocs
(Created page with "This file is included in the main directory of every type of plugin. It contains a number of fields, which are used during the install / upgrade process to make sure the plugin ...")
 
No edit summary
Line 8: Line 8:
* $plugin->version = 2011051000;
* $plugin->version = 2011051000;
** Required - the version number of your plugin in the form YYYYMMDDxx, so this example is 10th May 2011 (with 00 indicating this is the first version for that day)
** Required - the version number of your plugin in the form YYYYMMDDxx, so this example is 10th May 2011 (with 00 indicating this is the first version for that day)
* $plugin->cron = 0;
** Required - time interval (in seconds) between calls to the plugin's 'cron' function; set to 0 to disable the cron function calls.
* $plugin->requires = 2010112400;
* $plugin->requires = 2010112400;
** Optional - minimum version number of Moodle that this plugin requires (Moodle 1.9 = 2007101509; Moodle 2.0 = 2010112400; Moodle 2.1 = 2011070100)
** Optional - minimum version number of Moodle that this plugin requires (Moodle 1.9 = 2007101509; Moodle 2.0 = 2010112400; Moodle 2.1 = 2011070100)
* $plugin->cron = 0;
** Optional - time interval (in seconds) between calls to the plugin's 'cron' function; set to 0 to disable the cron function calls.
** Cron support is not implemented for all plugins.
* $plugin->component = 'plugintype_pluginname';
** Optional - ''frankenstyle'' plugin name, strongly recommended. It is used for installation and upgrade diagnostics.
* $plugin->maturity = MATURITY_STABLE;
* $plugin->maturity = MATURITY_STABLE;
** Optional - how stable the plugin is: MATURITY_ALPHA, MATURITY_BETA, MATURITY_RC, MATURITY_STABLE
** Optional - how stable the plugin is: MATURITY_ALPHA, MATURITY_BETA, MATURITY_RC, MATURITY_STABLE

Revision as of 18:13, 3 December 2011

This file is included in the main directory of every type of plugin.

It contains a number of fields, which are used during the install / upgrade process to make sure the plugin is compatible with the current Moodle install, as well as spotting whether an upgrade is needed.

The file is a standard PHP file, starting with an opening '<?php' tag and defining the following variables:


  • $plugin->version = 2011051000;
    • Required - the version number of your plugin in the form YYYYMMDDxx, so this example is 10th May 2011 (with 00 indicating this is the first version for that day)
  • $plugin->requires = 2010112400;
    • Optional - minimum version number of Moodle that this plugin requires (Moodle 1.9 = 2007101509; Moodle 2.0 = 2010112400; Moodle 2.1 = 2011070100)
  • $plugin->cron = 0;
    • Optional - time interval (in seconds) between calls to the plugin's 'cron' function; set to 0 to disable the cron function calls.
    • Cron support is not implemented for all plugins.
  • $plugin->component = 'plugintype_pluginname';
    • Optional - frankenstyle plugin name, strongly recommended. It is used for installation and upgrade diagnostics.
  • $plugin->maturity = MATURITY_STABLE;
    • Optional - how stable the plugin is: MATURITY_ALPHA, MATURITY_BETA, MATURITY_RC, MATURITY_STABLE
  • $plugin->release = '2.x (Build: 2011051000)';
    • Optional - Human-readable version name
  • $plugin->dependencies = array ('mod_forum' => ANY_VERSION, 'mod_data' => 2010020300);
    • Optional - list of other plugins that are required for this plugin to work
    • In this example, the plugin requires any version of the forum activity and version '20100020300' (or above) of the database activity