function apachesolr_environment_clone in Apache Solr Search 7
Same name and namespace in other branches
- 8 apachesolr.module \apachesolr_environment_clone()
- 6.3 apachesolr.module \apachesolr_environment_clone()
Function that clones an environment
Parameters
$env_id: The environment ID it needs to clone.
1 call to apachesolr_environment_clone()
- apachesolr_environment_clone_form_submit in ./
apachesolr.admin.inc - Submit handler for the clone form
File
- ./
apachesolr.module, line 1325 - Integration with the Apache Solr search application.
Code
function apachesolr_environment_clone($env_id) {
$environment = apachesolr_environment_load($env_id);
$environments = apachesolr_load_all_environments();
$environment['env_id'] = apachesolr_create_unique_id($environments, $env_id);
$environment['name'] = $environment['name'] . ' [cloned]';
apachesolr_environment_save($environment);
}