diff options
Diffstat (limited to 'includes/install.core.inc')
-rw-r--r-- | includes/install.core.inc | 91 |
1 files changed, 53 insertions, 38 deletions
diff --git a/includes/install.core.inc b/includes/install.core.inc index 7bcd026ae..9805e1c88 100644 --- a/includes/install.core.inc +++ b/includes/install.core.inc @@ -6,8 +6,7 @@ */ /** - * Global flag to indicate that a task should not be run during the current - * installation request. + * Do not run the task during the current installation request. * * This can be used to skip running an installation task when certain * conditions are met, even though the task may still show on the list of @@ -20,8 +19,7 @@ define('INSTALL_TASK_SKIP', 1); /** - * Global flag to indicate that a task should be run on each installation - * request that reaches it. + * Run the task on each installation request until the database is set up. * * This is primarily used by the Drupal installer for bootstrap-related tasks. */ @@ -200,7 +198,7 @@ function install_state_defaults() { } /** - * Begin an installation request, modifying the installation state as needed. + * Begins an installation request, modifying the installation state as needed. * * This function performs commands that must run at the beginning of every page * request. It throws an exception if the installation should not proceed. @@ -524,7 +522,7 @@ function install_tasks($install_state) { $needs_translations = count($install_state['locales']) > 1 && !empty($install_state['parameters']['locale']) && $install_state['parameters']['locale'] != 'en'; // Start with the core installation tasks that run before handing control - // to the install profile. + // to the installation profile. $tasks = array( 'install_select_profile' => array( 'display_name' => st('Choose profile'), @@ -708,7 +706,7 @@ function install_display_output($output, $install_state) { } /** - * Installation task; verify the requirements for installing Drupal. + * Verifies the requirements for installing Drupal. * * @param $install_state * An array of information about the current installation state. @@ -776,7 +774,7 @@ function install_system_module(&$install_state) { // variable_set() can be used now that system.module is installed. $modules = $install_state['profile_info']['dependencies']; - // The install profile is also a module, which needs to be installed + // The installation profile is also a module, which needs to be installed // after all the dependencies have been installed. $modules[] = drupal_get_profile(); @@ -785,7 +783,7 @@ function install_system_module(&$install_state) { } /** - * Verify and return the last installation task that was completed. + * Verifies and returns the last installation task that was completed. * * @return * The last completed task, if there is one. An exception is thrown if Drupal @@ -829,7 +827,7 @@ function install_verify_settings() { } /** - * Verify PDO library. + * Verifies the PDO library. */ function install_verify_pdo() { // PDO was moved to PHP core in 5.2.0, but the old extension (targeting 5.0 @@ -841,15 +839,14 @@ function install_verify_pdo() { } /** - * Installation task; define a form to configure and rewrite settings.php. + * Form constructor for a form to configure and rewrite settings.php. * - * @param $form_state - * An associative array containing the current state of the form. * @param $install_state * An array of information about the current installation state. * - * @return - * The form API definition for the database configuration form. + * @see install_settings_form_validate() + * @see install_settings_form_submit() + * @ingroup forms */ function install_settings_form($form, &$form_state, &$install_state) { global $databases; @@ -912,7 +909,9 @@ function install_settings_form($form, &$form_state, &$install_state) { } /** - * Form API validate for install_settings form. + * Form validation handler for install_settings_form(). + * + * @see install_settings_form_submit() */ function install_settings_form_validate($form, &$form_state) { $driver = $form_state['values']['driver']; @@ -969,7 +968,9 @@ function install_database_errors($database, $settings_file) { } /** - * Form API submit for install_settings form. + * Form submission handler for install_settings_form(). + * + * @see install_settings_form_validate() */ function install_settings_form_submit($form, &$form_state) { global $install_state; @@ -1000,7 +1001,7 @@ function install_find_profiles() { } /** - * Installation task; select which profile to install. + * Selects which profile to install. * * @param $install_state * An array of information about the current installation state. The chosen @@ -1040,8 +1041,7 @@ function install_select_profile(&$install_state) { } /** - * Helper function for automatically selecting an installation profile from a - * list or from a selection passed in via $_POST. + * Selects an installation profile from a list or from a $_POST submission. */ function _install_select_profile($profiles) { if (sizeof($profiles) == 0) { @@ -1064,12 +1064,14 @@ function _install_select_profile($profiles) { } /** - * Form API array definition for the profile selection form. + * Form constructor for the profile selection form. * * @param $form_state * Array of metadata about state of form processing. * @param $profile_files * Array of .profile files, as returned from file_scan_directory(). + * + * @ingroup forms */ function install_select_profile_form($form, &$form_state, $profile_files) { $profiles = array(); @@ -1246,7 +1248,9 @@ function install_select_locale(&$install_state) { } /** - * Form API array definition for language selection. + * Form constructor for the language selection form. + * + * @ingroup forms */ function install_select_locale_form($form, &$form_state, $locales, $profilename) { include_once DRUPAL_ROOT . '/includes/iso.inc'; @@ -1296,7 +1300,7 @@ function install_already_done_error() { } /** - * Installation task; load information about the chosen profile. + * Loads information about the chosen profile during installation. * * @param $install_state * An array of information about the current installation state. The loaded @@ -1315,7 +1319,7 @@ function install_load_profile(&$install_state) { } /** - * Installation task; perform a full bootstrap of Drupal. + * Performs a full bootstrap of Drupal during installation. * * @param $install_state * An array of information about the current installation state. @@ -1325,7 +1329,7 @@ function install_bootstrap_full(&$install_state) { } /** - * Installation task; install required modules via a batch process. + * Installs required modules via a batch process. * * @param $install_state * An array of information about the current installation state. @@ -1378,7 +1382,7 @@ function install_profile_modules(&$install_state) { } /** - * Installation task; import languages via a batch process. + * Imports languages via a batch process during installation. * * @param $install_state * An array of information about the current installation state. @@ -1412,15 +1416,14 @@ function install_import_locales(&$install_state) { } /** - * Installation task; configure settings for the new site. + * Form constructor for a form to configure the new site. * - * @param $form_state - * An associative array containing the current state of the form. * @param $install_state * An array of information about the current installation state. * - * @return - * The form API definition for the site configuration form. + * @see install_configure_form_validate() + * @see install_configure_form_submit() + * @ingroup forms */ function install_configure_form($form, &$form_state, &$install_state) { drupal_set_title(st('Configure site')); @@ -1443,7 +1446,7 @@ function install_configure_form($form, &$form_state, &$install_state) { // Add JavaScript time zone detection. drupal_add_js('misc/timezone.js'); // We add these strings as settings because JavaScript translation does not - // work on install time. + // work during installation. drupal_add_js(array('copyFieldValue' => array('edit-site-mail' => array('edit-account-mail'))), 'setting'); drupal_add_js('jQuery(function () { Drupal.cleanURLsInstallCheck(); });', 'inline'); // Add JS to show / hide the 'Email administrator about site updates' elements @@ -1486,7 +1489,7 @@ function install_import_locales_remaining(&$install_state) { } /** - * Installation task; perform final steps and display a 'finished' page. + * Finishes importing files at end of installation. * * @param $install_state * An array of information about the current installation state. @@ -1502,13 +1505,13 @@ function install_finished(&$install_state) { // Flush all caches to ensure that any full bootstraps during the installer // do not leave stale cached data, and that any content types or other items - // registered by the install profile are registered correctly. + // registered by the installation profile are registered correctly. drupal_flush_all_caches(); // Remember the profile which was used. variable_set('install_profile', drupal_get_profile()); - // Install profiles are always loaded last + // Installation profiles are always loaded last db_update('system') ->fields(array('weight' => 1000)) ->condition('type', 'module') @@ -1673,7 +1676,15 @@ function install_check_requirements($install_state) { } /** - * Forms API array definition for site configuration. + * Form constructor for a site configuration form. + * + * @param $install_state + * An array of information about the current installation state. + * + * @see install_configure_form() + * @see install_configure_form_validate() + * @see install_configure_form_submit() + * @ingroup forms */ function _install_configure_form($form, &$form_state, &$install_state) { include_once DRUPAL_ROOT . '/includes/locale.inc'; @@ -1786,7 +1797,9 @@ function _install_configure_form($form, &$form_state, &$install_state) { } /** - * Forms API validate for the site configuration form. + * Form validation handler for install_configure_form(). + * + * @see install_configure_form_submit() */ function install_configure_form_validate($form, &$form_state) { if ($error = user_validate_name($form_state['values']['account']['name'])) { @@ -1801,7 +1814,9 @@ function install_configure_form_validate($form, &$form_state) { } /** - * Forms API submit for the site configuration form. + * Form submission handler for install_configure_form(). + * + * @see install_configure_form_validate() */ function install_configure_form_submit($form, &$form_state) { global $user; |