provision_drupal_settings.tpl.php 3.74 KB
Newer Older
1
<?php print '<?php' ?>
2 3 4 5 6 7 8 9 10
  /**
   * The database credentials are stored in the Apache vhost config
   * of the associated site with SetEnv parameters.
   * They are called here with $_SERVER environment variables to 
   * prevent sensitive data from leaking to site administrators 
   * with PHP access, that potentially might be of other sites in
   * Drupal's multisite set-up.
   * This is a security measure implemented by the Aegir project.
   */
11
  $databases['default']['default'] = array(
12 13 14 15
    'driver' => "<?php print $this->creds['db_type']; ?>",
    'database' => "<?php print $this->creds['db_name']; ?>",
    'username' => "<?php print $this->creds['db_user']; ?>",
    'password' => "<?php print $this->creds['db_passwd']; ?>",
16
    'host' => "<?php print $this->creds['db_host']; ?>",
17
    'port' => "<?php print $this->creds['db_port']; ?>",
18
  );
19
  $db_url['default'] = "<?php print strtr("%db_type://%db_user:%db_passwd@%db_host:%db_port/%db_name", array(
20 21 22 23
    '%db_type' => $this->creds['db_type'],
    '%db_user' => $this->creds['db_user'], 
    '%db_passwd' => $this->creds['db_passwd'],
    '%db_host' => $this->creds['db_host'], 
24
    '%db_port' => $this->creds['db_port'], 
25
    '%db_name' => $this->creds['db_name'])); ?>";
26

27

28
  $profile = "<?php print $this->profile ?>";
29 30
  $install_profile = "<?php print $this->profile ?>";

31 32 33 34 35 36 37 38 39 40
  /**
  * PHP settings:
  *
  * To see what PHP settings are possible, including whether they can
  * be set at runtime (ie., when ini_set() occurs), read the PHP
  * documentation at http://www.php.net/manual/en/ini.php#ini.list
  * and take a look at the .htaccess file to see which non-runtime
  * settings are used there. Settings defined here should not be
  * duplicated there so as to avoid conflict issues.
  */
41 42 43 44 45 46 47 48 49 50 51
  @ini_set('arg_separator.output',     '&amp;');
  @ini_set('magic_quotes_runtime',     0);
  @ini_set('magic_quotes_sybase',      0);
  @ini_set('session.cache_expire',     200000);
  @ini_set('session.cache_limiter',    'none');
  @ini_set('session.cookie_lifetime',  0);
  @ini_set('session.gc_maxlifetime',   200000);
  @ini_set('session.save_handler',     'user');
  @ini_set('session.use_only_cookies', 1);
  @ini_set('session.use_trans_sid',    0);
  @ini_set('url_rewriter.tags',        '');
52

53 54 55 56 57 58
  /**
  * Set the umask so that new directories created by Drupal have the correct permissions
  */
  umask(0002);


59
  global $conf;
60 61 62
  $conf['install_profile'] = '<?php print $this->profile ?>';
  $conf['file_directory_path'] = 'sites/<?php print $this->uri ?>/files';
  $conf['file_directory_temp'] = 'sites/<?php print $this->uri ?>/files/tmp';
63 64
  $conf['clean_url'] = 1;

65
  <?php if (!$this->site_enabled) : ?>
66 67 68
    $conf['site_offline'] = 1;
  <?php endif ?>

69 70
<?php print $extra_config; ?>

71 72 73 74 75 76 77 78 79 80 81 82
  /**
  * This was added from Drupal 5.2 onwards.
  */
  /**
  * We try to set the correct cookie domain. If you are experiencing problems
  * try commenting out the code below or specifying the cookie domain by hand.
  */
  if (isset($_SERVER['HTTP_HOST'])) {
    $domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']);
    // Per RFC 2109, cookie domains must contain at least one dot other than the
    // first. For hosts such as 'localhost', we don't set a cookie domain.
    if (count(explode('.', $domain)) > 2) {
83
      @ini_set('session.cookie_domain', $domain);
84 85 86
    }
  }

87
  # Additional site configuration settings.
88 89
  if (file_exists('<?php print $this->site_path  ?>/local.settings.php')) {
    include_once('<?php print $this->site_path  ?>/local.settings.php');
90 91
  }

92
  # Additional host wide configuration settings. Useful for safely specifying configuration settings.
93 94
  if (file_exists('<?php print $this->platform->server->include_path  ?>/global.inc')) {
    include_once('<?php print $this->platform->server->include_path  ?>/global.inc');
95
  }