1 install.core.inc install_backup_location(&$install_state)

Installation task; Rewrite settings.php to include backup location.

File

core/includes/install.core.inc, line 954
API functions for installing Backdrop.

Code

function install_backup_location(&$install_state) {
  global $settings, $databases;

  $backup_directory = isset($settings['backup_directory']) ? $settings['backup_directory'] : '';
  // A value of FALSE disables backups and will not rewrite on install.
  if (empty($backup_directory) && $backup_directory !== FALSE) {
    $backup_directory = 'files/backups_' . md5(json_encode($databases) . backdrop_random_bytes(10));
    $update_settings["settings['backup_directory']"] = array(
      'value' => $backup_directory,
      'required' => TRUE,
    );

    // Backup directory is optional, so continue even if it can't be written.
    try {
      backdrop_rewrite_settings($update_settings);
    }
    catch (Exception $e) {
    }
  }
}