function tripal_example_requirements
2.x tripal_example.install | tripal_example_requirements($phase) |
Implements hook_requirements().
Performs check to see if all required dependencies are met. Drupal will automatically check for module dependencies but here you can check for other requirements.
File
- tripal_example/
tripal_example.install, line 41 - Installation of the example module
Code
function tripal_example_requirements($phase) {
$requirements = array();
if ($phase == 'install') {
// EXPLANATION: It is essential that Chado be installed for almost all
// Tripal modules. Therefore, the following code checks to ensure Chado is
// installed and available. If your module does not require that Chado be
// installed, you can remove the following check.
// make sure chado is installed
if (!$GLOBALS["chado_is_installed"]) {
$requirements['tripal_example'] = array(
'title' => "tripal_example",
'value' => "ERROR: Chado must be installed before this module can be enabled",
'severity' => REQUIREMENT_ERROR,
);
}
}
return $requirements;
}