Score:2

How do I know which services.yml is active?

cn flag

If I have multiple services.yml in the sites/default/ directory, how can I determine which one Drupal is actually loading?

Is there a drush command to check this? Or is there some other way to verify which services file is being used by a site?

4uk4 avatar
cn flag
I'm wondering how you can have multiple files with the same name? If you have files with different names you need to add them to `$settings['container_yamls']` in settings.php. You can compile the service container with as many yaml files as you want. For example modules can provide yaml files, too, which are loaded without settings.
cn flag
@4k4 I was confused by this "Best practices" recommendation from the Site Audit module: Site-specific services.yml in use. `Use of a site-specific services.yml is unnecessary for most sites, and can cause issues as it overrides core.services.yml. See https://www.drupal.org/project/drupal/issues/2547447.`
Score:2
cn flag

The info is stored in global settings, but it isn't necessarily one file. To get the currently active list:

$container_yamls = \Drupal\Core\Site\Settings::get('container_yamls');
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.