function drush_config_devel_get_type in Configuration development 8
Gets the type for the given extension.
Parameters
string $extension: extension name
Return value
string module, theme, profile, or FALSE if no valid extension provided.
2 calls to drush_config_devel_get_type()
- drush_config_devel_export in drush/
config_devel.drush.inc - Drush command callback.
- drush_config_devel_import in drush/
config_devel.drush.inc - Drush command callback.
File
- drush/
config_devel.drush.inc, line 245 - Configuration development module drush integration.
Code
function drush_config_devel_get_type($extension) {
$type = NULL;
if (\Drupal::moduleHandler()
->moduleExists($extension)) {
$type = 'module';
}
elseif (\Drupal::service('theme_handler')
->themeExists($extension)) {
$type = 'theme';
}
elseif (\Drupal::installProfile() === $extension) {
$type = 'profile';
}
return $type;
}