The direct answer to your question (can you use "OR" in an .info
file?) has already been provided, but the actual functional outcome you're looking for can be achieved with hook_requirements. For instance, you might use this code in my_module.install
:
function my_module_requirements($phase) {
$requirements = array();
if ($phase == 'install') {
if (module_exists('submodule1') && module_exists('submodule2')) {
$requirements['too_many_modules'] = array(
'title' => $t('Too many modules'),
'description' => t('You may not enable submodule1 and submodule2 simultaneously'),
'value' => 'Too many modules',
'severity' => REQUIREMENT_ERROR,
);
}
if (!module_exists('submodule1') && !module_exists('submodule2')) {
$requirements['not_enough_modules'] = array(
'title' => $t('Not enough modules'),
'description' => t('You must enable submodule1 or submodule2 (but not both)'),
'value' => 'Not enough modules',
'severity' => REQUIREMENT_ERROR,
);
}
}
return $requirements;
}
Further reading