Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.131
diff -u -F^f -r1.131 bootstrap.inc
--- includes/bootstrap.inc	22 Nov 2006 09:07:03 -0000	1.131
+++ includes/bootstrap.inc	22 Nov 2006 10:21:00 -0000
@@ -191,6 +191,18 @@ function conf_init() {
  * Returns and optionally sets the filename for a system item (module,
  * theme, etc.). The filename, whether provided, cached, or retrieved
  * from the database, is only returned if the file exists.
+ * 
+ * This function plays a key role in allowing Drupal's resources (modules
+ * and themes) to be located in different places depending on a site's
+ * configuration. For example, a module may legally be be located in any
+ * of these three places:
+ * 
+ * modules/mymod/mymod.module
+ * sites/all/modules/mymod/mymod.module
+ * sites/mysite/modules/mymod/mymod.module
+ * 
+ * Calling drupal_get_filename('module', 'mymod') will give you
+ * one of the above, depending on where the module is located.
  *
  * @param $type
  *   The type of the item (i.e. theme, theme_engine, module).
@@ -200,8 +212,11 @@ function conf_init() {
  *   The filename of the item if it is to be set explicitly rather
  *   than by consulting the database.
  * @param $check_db
- *   Allows the database search to be skipped (useful for pre-bootstrap
- *   checks where configuration paths must still be respected).
+ *   If TRUE, the system table in the database will be consulted for the file
+ *   locations. If FALSE, this step will be skipped. Using FALSE is useful
+ *   for cases where there is no database connection or during initial
+ *   bootstrap phases where locations are either the defaults or those
+ *   specified in the global $conf.
  *
  * @return
  *   The filename of the requested item.
@@ -789,8 +804,8 @@ function drupal_maintenance_theme() {
   require_once './includes/unicode.inc';
   require_once './modules/filter/filter.module';
   unicode_check();
-  drupal_add_css(drupal_get_path('module', 'system') .'/defaults.css', 'core');
-  drupal_add_css(drupal_get_path('module', 'system') .'/system.css', 'core');
+  drupal_add_css(drupal_get_path('module', 'system', FALSE) .'/defaults.css', 'core');
+  drupal_add_css(drupal_get_path('module', 'system', FALSE) .'/system.css', 'core');
   $theme = '';
 }
 
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.589
diff -u -F^f -r1.589 common.inc
--- includes/common.inc	21 Nov 2006 19:40:09 -0000	1.589
+++ includes/common.inc	22 Nov 2006 10:21:01 -0000
@@ -1252,12 +1252,14 @@ function drupal_eval($code) {
  *   The type of the item (i.e. theme, theme_engine, module).
  * @param $name
  *   The name of the item for which the path is requested.
+ * @param $check_db
+ *   This should be FALSE in cases where there is no database connection available.
  *
  * @return
  *   The path to the requested item.
  */
-function drupal_get_path($type, $name) {
-  return dirname(drupal_get_filename($type, $name));
+function drupal_get_path($type, $name, $check_db = TRUE) {
+  return dirname(drupal_get_filename($type, $name, NULL, $check_db));
 }
 
 /**
