function install_select_profile
Same name in other branches
- 7.x includes/install.core.inc \install_select_profile()
- 8.9.x core/includes/install.core.inc \install_select_profile()
- 10 core/includes/install.core.inc \install_select_profile()
- 11.x core/includes/install.core.inc \install_select_profile()
Selects which profile to install.
Parameters
$install_state: An array of information about the current installation state. The chosen profile will be added here, if it was not already selected previously, as will a list of all available profiles.
Return value
array|null For interactive installations, a form allowing the profile to be selected, if the user has a choice that needs to be made. Otherwise, an exception is thrown if a profile cannot be chosen automatically.
File
-
core/
includes/ install.core.inc, line 1232
Code
function install_select_profile(&$install_state) {
if (empty($install_state['parameters']['profile'])) {
// If there are no profiles at all, installation cannot proceed.
if (empty($install_state['profiles'])) {
throw new NoProfilesException(\Drupal::service('string_translation'));
}
// Try to automatically select a profile.
if ($profile = _install_select_profile($install_state)) {
$install_state['parameters']['profile'] = $profile;
}
else {
// The non-interactive installer requires a profile parameter.
if (!$install_state['interactive']) {
throw new InstallerException('Missing profile parameter.');
}
// Otherwise, display a form to select a profile.
return install_get_form('Drupal\\Core\\Installer\\Form\\SelectProfileForm', $install_state);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.