[drupal-devel] Cleaner Directory structure

K B kbahey at gmail.com
Wed May 11 19:48:30 UTC 2005


> What I am suggesting is a small change like the one at the end of this
> email. It will give the opportunity to maintain all or modst of the
> scenarios described so far, and will make drupal more packageable by the
> distributions, as . The downside is that it will require a central
> configuration file ( put in /etc/drupal ;)
> 
> This suggestion should not have any performance implications, as far as
> I am aware, apart from the loading of the configuration file, let's be
> serious.
> 
> I wouldn't argue with any default directory scheme suggested, I like the
> current one myself, as long as it is trivial (read standard and
> configurable) for an admin to set up the directory structure they like,
> and drupal is packageable without modifications bar config by debian.
> 
> Be flexible if it doesn't hurt you.
> 
> Cheers, Vlado

I think your idea has a lot of merit, and provides excellent flexibility.

What I am not clear on is, for shared hosting, where would this file go?

Also, how does it map into the notion "a directory that does not need
to be changed" which I am lobbying for? My goal is to reduce clutter
in the parent directory, and provide a drop in upgrade feature for
core.

I think we can marry the two ideas (mine, and yours) like this:


public_html/.htaccess.example
public_html/index.php
public_html/drupal/
public_html/drupal/drupal.php <==== THIS IS THE NEW FILE
public_html/drupal/includes/
public_html/drupal/modules/
public_html/drupal/themes/
public_html/drupal/misc/
public_html/drupal/doc (contains all the .TXT files)
public_html/local/
public_html/local/sites
public_html/local/sites/default/
public_html/local/sites/default/settings.php.example
public_html/local/modules (contrib modules that are shared for all
sites - empty)
public_html/local/themes (contrib themes that are shared for all sites - empty)

In the drupal.php file, we have this:

<?php
// Directory where drupal core is located
$drupal_core = 'drupal';
// Directory where site configurations, and contributed modules and
themes are located
$drupal_sites  = 'local';
?>

conf_init() will be like this:

 $drupal_conf='drupal/drupal.php';

 foreach (array("$sites/$config/$dir/$file",
 "$sites/$config/$dir/$name/$file", "$core/$dir/$file",
 "$core/$dir/$name/$file") as $file) {
   if (file_exists($file)) {
     $files[$type][$name] = $file;
     break;
   }
 }
 
This achieves everything I wanted for shared hosting, where drop in
upgrade is easy, and there is no clutter.

Yet, with your added flexibility, distros can change $drupal_conf to
anything they like, and/or the contents of the drupal.php file as
well.



More information about the drupal-devel mailing list