Implement a global.inc to set up important $conf variables like the file path

adrian - June 28, 2008 - 01:00
Project:Hosting
Version:5.x-0.1-alpha2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Uploads are currently broken on provisioned sites, because they try to upload into 'files'

The configurations generated already have a conditional include to load a global.inc, but it is pointing to inside the drupal checkout.

This should be placed in the PROVISION_CONFIG_PATH , so probably config/drupal/global.inc (outside of the web root).

This is what we have in our hm1 global.inc

<?php
/**
* 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 <a href="http://www.php.net/manual/en/ini.php#ini.list
" title="http://www.php.net/manual/en/ini.php#ini.list
" rel="nofollow">http://www.php.net/manual/en/ini.php#ini.list
</a> * 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.
*/
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',        '');

global
$conf;
$conf['file_directory_path'] = conf_path() . '/files';
$conf['file_directory_temp'] = conf_path() . '/files/tmp';
$conf['file_downloads'] = 1;
$conf['cache'] = 1;
$conf['clean_url'] = 1;

/**
* 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) {
   
ini_set('session.cookie_domain', $domain);
  }
}
?>

#1

anarcat - July 4, 2008 - 20:05
Status:active» needs work

I changed the template so it includes from PROVISION_CONFIG_PATH. I'm not sure how or where to generate the global.inc file though... platform verify?

#2

adrian - July 9, 2008 - 21:33

I'm thinking i should just add this to the settings.php code template. Makes more sense than trying to keep a central php file updated for all platforms, or keeping a global.inc per platform.

#3

anarcat - July 9, 2008 - 21:36

I agree.

#4

adrian - July 9, 2008 - 22:29
Status:needs work» fixed

committed into head.

#5

adrian - July 9, 2008 - 23:08

This does cause some warnings, because of ini_set in settings.php files. This is kind of expected, and theres nothing we can do about this,
so during import i re-include the settings.php of the provisioning site, so it at least sets back to what it had before.

#6

Anonymous (not verified) - July 31, 2008 - 04:47
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.