diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 6e2cc67..53b7a5f 100755 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -690,6 +690,7 @@ function install_tasks_to_perform($install_state) { * A list of tasks, with associated metadata. */ function install_tasks($install_state) { + global $settings; // Determine whether a translation file must be imported during the // 'install_import_translations' task. Import when a non-English language is // available and selected. @@ -701,8 +702,8 @@ function install_tasks($install_state) { // Determine whether we are hiding some options that can be pre-selected. $multiple_profiles = count($install_state['profiles']) != 1; - $profile_preselected = isset($install_state['parameters']['profile']) && !empty($install_state['parameters']['profile']); - $language_preselected = isset($install_state['parameters']['langcode']) && !empty($install_state['parameters']['langcode']); + $profile_preselected = isset($settings['parameters']['profile']) && !empty($settings['parameters']['profile']); + $language_preselected = isset($settings['parameters']['langcode']) && !empty($settings['parameters']['langcode']); // Start with the core installation tasks that run before handing control // to the installation profile. diff --git a/core/install.php b/core/install.php index 15764a8..f7418ae 100755 --- a/core/install.php +++ b/core/install.php @@ -26,15 +26,12 @@ exit; } +$settings = array(); // Look for a distribution file. -if (is_file(DRUPAL_ROOT . '/profiles/distribution.php')) { - include(DRUPAL_ROOT . '/profiles/distribution.php'); +if (is_readable(dirname(__DIR__) . '/profiles/distribution.php')) { + include dirname(__DIR__) . '/profiles/distribution.php'; } -// Make sure a $settings array exists. There may not have been one in the file. -if (!isset($settings)) { - $settings = array(); -} // Start the installer. require_once __DIR__ . '/includes/install.core.inc'; install_drupal($settings); diff --git a/core/profiles/example.distribution.php b/core/profiles/example.distribution.php index 3803392..4e193b3 100755 --- a/core/profiles/example.distribution.php +++ b/core/profiles/example.distribution.php @@ -16,11 +16,38 @@ * */ -$settings = array( - 'interactive' => TRUE, - 'parameters' => array( - 'profile' =>'standard', - 'langcode' => 'en', - ), - 'theme' => 'stark', -); \ No newline at end of file +// Whether a translation file for the selected language will be downloaded +// from the translation server. +$settings['download_translation'] = FALSE; +// An array of forms to be programmatically submitted during the +// installation. The keys of each element indicate the name of the +// installation task that the form submission is for, and the values are +// used as the $form_state['values'] array that is passed on to the form +// submission via drupal_form_submit(). +$settings['forms'] = array(); +// Whether or not this installation is interactive. By default this will +// be set to FALSE if settings are passed in to install_drupal(). +$settings['interactive'] = TRUE; +// An array of parameters for the installation, pre-populated by the URL +// or by the settings passed in to install_drupal(). This is primarily +// used to store 'profile' (the name of the chosen installation profile) +// and 'langcode' (the code of the chosen installation language), since +// these settings need to persist from page request to page request before +// the database is available for storage. +$settings['parameters'] = array( + 'profile' => 'standard', + 'langcode' => 'en', +); +// An array of server variables that will be substituted into the global +// $_SERVER array via drupal_override_server_variables(). Used by +// non-interactive installations only. +$settings['server'] = array(); +// The server URL where the interface translation files can be downloaded. +// Tokens in the pattern will be replaced by appropriate values for the +// required translation file. +$settings['server_pattern'] = 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po'; +// An array of translation files URIs available for the installation. Keyed +// by the translation language code. +$settings['translations'] = array(); +// The name of the default theme to use. +$settings['theme'] = 'stark';