diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-02 03:46:43 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-02 03:46:43 +0000 |
commit | 3b427fae37f1c706a65f987c6472fe41039f996c (patch) | |
tree | b9183c79c4682a3e03bc73cc48a72b5c56b35f89 /includes | |
parent | 0e44b42baf5e4c5b18979b2d5905eb3c7d38716a (diff) | |
download | brdo-3b427fae37f1c706a65f987c6472fe41039f996c.tar.gz brdo-3b427fae37f1c706a65f987c6472fe41039f996c.tar.bz2 |
#341140 follow-up by JohnAlbin and chx: drupal_get_filename() fails for PHPTemplate themes when database is down.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/bootstrap.inc | 11 | ||||
-rw-r--r-- | includes/common.inc | 5 |
2 files changed, 7 insertions, 9 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 7ab4f2b65..191977f5c 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -677,11 +677,12 @@ function drupal_get_filename($type, $name, $filename = NULL) { $mask = "/$name\.$type$/"; } - if (function_exists('drupal_system_listing')) { - $matches = drupal_system_listing($mask, $dir, 'name', 0); - if (!empty($matches[$name]->uri)) { - $files[$type][$name] = $matches[$name]->uri; - } + if (!function_exists('drupal_system_listing')) { + require_once DRUPAL_ROOT . '/includes/common.inc'; + } + $matches = drupal_system_listing($mask, $dir, 'name', 0); + if (!empty($matches[$name]->uri)) { + $files[$type][$name] = $matches[$name]->uri; } } } diff --git a/includes/common.inc b/includes/common.inc index ff2c81776..de7674380 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -4499,13 +4499,10 @@ function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1) $searchdir[] = "$config/$directory"; } - // If the database is not available, we can't use function_exists(), so - // we load the file_scan_directory function definition manually. + // Get current list of items if (!function_exists('file_scan_directory')) { require_once DRUPAL_ROOT . '/includes/file.inc'; } - - // Get current list of items foreach ($searchdir as $dir) { $files = array_merge($files, file_scan_directory($dir, $mask, array('key' => $key, 'min_depth' => $min_depth))); } |