1 config.inc | config_uninstall_config($project) |
Uninstall all the configuration provided by a project.
@since 1.26.0 The first parameter has been changed from $module to $project. @since 1.30.0 Unused parameter $config_name removed.
Parameters
string $project: The name of the project we are uninstalling.
File
- core/
includes/ config.inc, line 324 - This is the API for configuration storage.
Code
function config_uninstall_config($project) {
// If this is a theme key, load the matching template.php file.
if (!backdrop_load('module', $project) && $theme_path = backdrop_get_path('theme', $project)) {
if (file_exists($theme_path . '/template.php')) {
include_once $theme_path . '/template.php';
}
}
if ($configs = module_invoke($project, 'config_info')) {
foreach ($configs as $config_name => $config_info) {
if (isset($config_info['name_key'])) {
$sub_names = config_get_names_with_prefix($config_name . '.');
foreach ($sub_names as $sub_name) {
config($sub_name)->delete();
}
}
else {
config($config_name)->delete();
}
}
}
}