diff -u b/core/includes/bootstrap.inc b/core/includes/bootstrap.inc --- b/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -212,14 +212,6 @@ // drupal_static(). static $files = array(); - // We use drupal_static() for the missing records so we can test it. - // drupal_static_fast() is used as this function may be called often. - static $drupal_static_fast; - if (!isset($drupal_static_fast)) { - $drupal_static_fast['missing'] = &drupal_static(__FUNCTION__ . ':missing'); - } - $missing = &$drupal_static_fast['missing']; - // Type 'core' only exists to simplify application-level logic; it always maps // to the /core directory, whereas $name is ignored. It is only requested via // drupal_get_path(). /core/core.info.yml does not exist, but is required @@ -257,43 +249,15 @@ if (!isset($files[$type][$name]) && \Drupal::hasService('state')) { $files[$type] += \Drupal::state()->get('system.' . $type . '.files', array()); } - // If still unknown, perform a filesystem scan. + // If still unknown, create a user-level error message. if (!isset($files[$type][$name])) { - if (!isset($missing)) { - $missing = array(); - if (\Drupal::hasService('cache.bootstrap')) { - $cache = \Drupal::cache('bootstrap')->get('drupal_get_filename:missing'); - if ($cache && $cache->data) { - $missing = $cache->data; - } - } - } - if (!isset($missing[$type][$name])) { - $listing = new ExtensionDiscovery(DRUPAL_ROOT); - // Prevent an infinite recursion by this legacy function. - if ($original_type == 'profile') { - $listing->setProfileDirectories(array()); - } - foreach ($listing->scan($original_type) as $extension_name => $file) { - $files[$type][$extension_name] = $file->getPathname(); - } - } + trigger_error(SafeMarkup::format('The following @type is missing from the file system: @name', array('@type' => $type, '@name' => $name)), E_USER_WARNING); } } if (isset($files[$type][$name])) { return $files[$type][$name]; } - elseif (!isset($missing[$type][$name])) { - // Add the missing file to a temporary cache and throw an alert. This cache - // will be cleared on cron runs as well as when visiting the module and - // theme list pages. - $missing[$type][$name] = TRUE; - if (\Drupal::hasService('cache.bootstrap')) { - \Drupal::cache('bootstrap')->set('drupal_get_filename:missing', $missing, REQUEST_TIME + 24 * 60 * 60); - } - trigger_error(SafeMarkup::format('The following @type is missing from the file system: @name', array('@type' => $type, '@name' => $name)), E_USER_WARNING); - } } /**