You are here

function apachesolr_environment_clone in Apache Solr Search 8

Same name and namespace in other branches
  1. 6.3 apachesolr.module \apachesolr_environment_clone()
  2. 7 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 1317
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);
}