You are here

function hook_upgrade_info in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_upgrade/coder_upgrade.api.php \hook_upgrade_info()

Declares upgrade sets for an API (or set of APIs).

This hook allows contributed modules to declare upgrade sets for an API supplied by their module, another contributed module, or a core module. To be able to apply the upgrade routines independently, the upgrade routines should be contained in separate files.

For example, if your module is called 'your_module_name' and its upgrade routines are in 'your_module_name.upgrade' (the default file name), then declare an upgrade set as:

function your_module_name_upgrade_info() {
  $upgrade = array(
    'title' => t('Your module API changes from 6.x to 7.x'),
    'link' => 'http://...',
  );
  return array(
    'your_module_name' => $upgrade,
  );
}

Return value

An associative array (keyed on the upgrade name) with each element being an associative array with the following elements:

  • 'title': A description of the upgrade routines provided by the upgrade set.
  • 'link': An optional link to an issue describing the upgrade routines.
  • 'module': The name of the module providing the upgrade routines.
  • 'files': An optional array of file names containing the upgrade routines. The name includes any relative path inside the module directory. Defaults to 'your_module_name.upgrade'.
2 functions implement hook_upgrade_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

coder_upgrade_upgrade_info in coder_upgrade/conversions/list.inc
Implements hook_upgrade_info().
your_module_name_upgrade_info in coder_upgrade/coder_upgrade.api.php
Implements hook_upgrade_info().
1 invocation of hook_upgrade_info()
_coder_upgrade_upgrades in coder_upgrade/conversions/list.inc
Returns the list of upgrade sets from all modules.

File

coder_upgrade/coder_upgrade.api.php, line 45
Documents hooks provided by this module.

Code

function hook_upgrade_info() {
  $upgrade = array(
    'title' => t('Your module API changes from 6.x to 7.x'),
    'link' => 'http://...',
    'module' => 'your_module_name',
    'files' => array(
      'upgrades/your_module_name.upgrade',
    ),
  );
  return array(
    'your_upgrade_name' => $upgrade,
  );
}