Objective

  1. Given #2241633: Simplify site-specific service overrides, a services.yml file in the site directory is automatically picked up.

  2. Various services are environment-configurable via $settings in settings.php (→ Settings); e.g.:

    $settings['twig_debug'] = TRUE;
    

    …whereas these are consumed and injected basically like an $options hashmap:

    class CoreServiceProvider {
      public function register(ContainerBuilder $container) {
        $container
          ->register('twig', 'Drupal\Core\Template\TwigEnvironment')
          ->addArgument(array(
            'debug' => Settings::get('twig_debug', FALSE),
          ) + $default_options);
      }
    }
    
  3. Various factory services can be customized via $settings in settings.php (→ Settings); e.g.:

    $settings['keyvalue_service_state'] = 'keyvalue.database';
    

    …whereas these are consumed by a ContainerAware factory:

    class KeyValueFactory {
      public function get($collection) {
        // [simplified for clarity]
        $service_id = Settings::get('keyvalue_service_' . $collection, 'keyvalue.database');
        return $this->container->get($service_id)->get($collection);
      }
    }
    
  4. In both cases, Settings actually presents an alien to the code.

  5. In addition, each of those $settings in settings.php requires additional documentation to explain that changes to them are only picked up after rebuilding the service container.

Proposed solution

  1. Instead of $settings in settings.php, leverage the new services.yml file to specify container parameters:

    parameters:
      twig.config:
        debug: true
        auto_reload: true
      keyvalue.services:
        state: keyvalue.database
    
CommentFileSizeAuthor
#71 requirements.png55.29 KBdawehner
#71 2251113-70.patch46.83 KBdawehner
#71 interdiff.txt701 bytesdawehner
#66 2251113.66.patch46.15 KBalexpott
#66 62-66-interdiff.txt19.93 KBalexpott
#62 container_parameters-2251113-62.patch45.35 KBdawehner
#62 interdiff.txt1.18 KBdawehner
#54 interdiff.txt2.75 KBdawehner
#54 container_parameters-2251113-54.patch45.35 KBdawehner
#46 2251113-46.patch46.1 KBdamiankloip
#45 2251113-45.patch43.88 KBdamiankloip
#44 interdiff-2251113-44.txt7.81 KBdamiankloip
#44 2251113-44.patch46.39 KBdamiankloip
#37 parameters-2251113-37.patch46.22 KBdawehner
#35 parameters-2251113-32.patch46.23 KBdawehner
#32 interdiff.txt1007 bytesCrell
#32 parameters-2251113-32.patch46.23 KBCrell
#31 interdiff.txt978 bytesdawehner
#31 parameters-2251113-31.patch46.23 KBdawehner
#26 parameters-2251113-26.patch46.21 KBwim leers
#24 interdiff.txt2.29 KBwim leers
#24 parameters-2251113-24.patch946.32 KBwim leers
#22 interdiff.txt5.76 KBdawehner
#19 parameters-2251113-19.patch42.38 KBdawehner
#19 interdiff.txt594 bytesdawehner
#17 parameters-2251113-17.patch42.41 KBdawehner
#15 interdiff.txt8.24 KBdawehner
#15 parameters-2251113-15.patch42.36 KBdawehner
#13 interdiff.txt4.63 KBdawehner
#13 parameters-2251113-13.patch36.25 KBdawehner
#12 parameters-2251113-11.patch35.68 KBdawehner
#12 interdiff.txt7.19 KBdawehner
#11 interdiff.txt7.19 KBdawehner
#11 parameters-2251113-11.patch35.68 KBdawehner
#9 parameters-2251113-9.patch29.59 KBdawehner
#4 container.params.4.patch12.19 KBsun

Comments

sun’s picture

dawehner’s picture

I asked myself multiple time why we don't use container parameters. Some possible answers could be: you need to rebuild the container to get new data in there (at least by default),
we just didn't knew about that etc.

This basically means that all Settings we do have are things which are needed before the container is booted up, and so it is a limited amount of usecases we potentially could
all add new methods onto Settings.

berdir’s picture

The way Settings *started* was for things that we need *before* we have a container, like the APC classloader setting.

sun’s picture

StatusFileSize
new12.19 KB

Initial prototype to see how it could work + look like.

Converting the two examples that happen to be contained in the issue summary.

sun’s picture

Status: Active » Needs review

The change to Twig worked fine; the change to state (keyvalue) somehow triggers a circular dependency... anyway, needs review. :-)

Status: Needs review » Needs work

The last submitted patch, 4: container.params.4.patch, failed testing.

Crell’s picture

This makes sense to me, and seems like a good use of the tools already at our disposal. Caveat is the need to rebuild the container any time you change these values. We have rebuild.php right now, but to make that really easy we ought to add a CLI version too. That would, for me, adequately address the DX question.

+++ b/core/lib/Drupal/Core/CoreServiceProvider.php
@@ -42,11 +42,12 @@ class CoreServiceProvider implements ServiceProviderInterface  {
+    $container->setParameter('app.root', DRUPAL_ROOT);
+

I especially love this!

sun’s picture

  1. Note: Settings that are consumed by service provider classes require a container rebuild already today. (e.g., the Twig settings)

    Moving all of those into services.yml inherently self-documents on its own that the container needs to be rebuilt for changes to take effect.

  2. The common 'factory.' prefix for parameters of factories tries to address #2160705: settings.php setting names are inconsistent (and undocumented) through a simple standard pattern:

    parameters:
      factory.foo
        default: foo.database
    

    The idea is that all (ContainerAware) factories would follow this pattern. That way, whenever you see a factory that gets a %factory.xyz% parameter injected, you immediately know how to customize the services, and you know where to look up the default parameter.

  3. Most settings would be converted into container parameters. As @Berdir said, settings only exist for pre-kernel/container configuration. (e.g., custom classloader)

    We likely want to adjust the installer to write a services.yml file. (which will be a lot easier than the current code for rewriting the raw PHP code of settings.php)

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new29.59 KB

Added a couple of bits:

  • Ensured that the keyvalue setting is used in the kernelTestBase, so there are much less failures
  • Adapted the code in install.core.inc to write a install.php/services.yml file, wanted to do that anyway for backend overrides

Status: Needs review » Needs work

The last submitted patch, 9: parameters-2251113-9.patch, failed testing.

dawehner’s picture

StatusFileSize
new35.68 KB
new7.19 KB

Some progress ...

dawehner’s picture

StatusFileSize
new7.19 KB
new35.68 KB
dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new36.25 KB
new4.63 KB

This fixes some of the failures. The remaining ones are caused by the missing functionality of being able to inject parameters into the kernel container rebuild.

Status: Needs review » Needs work

The last submitted patch, 13: parameters-2251113-13.patch, failed testing.

dawehner’s picture

Assigned: sun » Unassigned
Status: Needs work » Needs review
StatusFileSize
new42.36 KB
new8.24 KB

The YamlFileLoader had internal caching which caused issues as cache is per file, so changing the services.yml file doesn't end up in the container.

Remove the assignment so it is clear that this kinda ready for review.

Status: Needs review » Needs work

The last submitted patch, 15: parameters-2251113-15.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new42.41 KB

Rerolled.

Status: Needs review » Needs work

The last submitted patch, 17: parameters-2251113-17.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new594 bytes
new42.38 KB

This could be it.

wim leers’s picture

Shouldn't this patch also remove the twig debug/autoreload/cache/… settings from example.settings.local.php?

Other than that, I only could find one nitpick. I looked at everything except the installer.

+++ b/core/INSTALL.txt
@@ -147,26 +147,29 @@ INSTALLATION
+      Drupal will try to automatically create a settings.php/servces.yml configuration file,

80 cols.

Crell’s picture

I couldn't find anything other than #20 to object to, either. Thanks, dawehner!

dawehner’s picture

StatusFileSize
new46.2 KB
new5.76 KB

Shouldn't this patch also remove the twig debug/autoreload/cache/… settings from example.settings.local.php?

Good catch. I decided to copy over the documentation of the settings.php example into the yml file.

80 cols.

It is so great that we have this standards, now the patch just gets much "easier" to review.

dawehner’s picture

Issue tags: +Drupalaton 2014

Tagging.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new946.32 KB
new2.29 KB

Fixed a typo and more 80 cols nitpicks.

Combined with #21, I think this is RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 24: parameters-2251113-24.patch, failed testing.

wim leers’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new46.21 KB

Oops! A lot of unrelated stuff ended up in that patch.

wim leers’s picture

This needs a change record, but it needs to update an existing change record. But https://www.drupal.org/node/1922666 is already published and we'd need to create a draft revision of the changes, which d.o doesn't support. So I created a new draft change notice that contains the changes over at https://www.drupal.org/node/2317817. We can then copy that to the existing change record once this is committed.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record

We need a change record that announces that the installer is going to create a services.yml file - or fail if it can not create one.

wim leers’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs change record
neclimdul’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/INSTALL.txt
@@ -147,26 +147,30 @@ INSTALLATION
+      file sites/default/default.settings.php/default.services.yml as a
...
+      default.settings.php/default.services.yml file with the command:

This doesn't look right. I think you're using "/" to mean "or" but we're talking about file paths in this context and / has a very specific meaning.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new46.23 KB
new978 bytes

what about that?

Crell’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new46.23 KB
new1007 bytes

files should be plural. (Do not credit me.)

dawehner’s picture

Priority: Normal » Critical

This seems actually rather major tbh.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 32: parameters-2251113-32.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new46.23 KB

Perfect 3way merge.

Status: Needs review » Needs work

The last submitted patch, 35: parameters-2251113-32.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new46.22 KB

not my day.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

it is green

larowlan’s picture

+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -1022,6 +1025,26 @@ protected function writeSettings(array $settings) {
+  protected function containerParameterSet($name, $value) {
+    $filename = $this->siteDirectory . '/services.yml';
+    chmod($filename, 0666);
+
+    $services = Yaml::decode(file_get_contents($filename));
+    $services['parameters'][$name] = $value;
+    file_put_contents($filename, Yaml::encode($services));
+
+    // Clear the YML file cache.
+    YamlFileLoader::reset();
+  }

how much cleaner is this than our writing of php in settings.php in the installer.

love it.

next step down this path - db connection settings...

dawehner’s picture

db connection settings is a litte bit difficult due to fast page caching.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Needs work

Are we OK with all of this backend config being exposed to the public? Cache backends, bins, etc.? As far as I can tell .yml files are served up by our default .htaccess rules. I suggest we block that for whole Drupal site. If I am off base here, please reset to RTBC.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community

Are we OK with all of this backend config being exposed to the public? Cache backends, bins, etc.? As far as I can tell .yml files are served up by our default .htaccess rules. I suggest we block that for whole Drupal site. If I am off base here, please reset to RTBC.

We should absolutely block them but well, services.yml already exists, so opened a follow up #2321487: Ensure to not serve yml files inside Drupal

@crell agreed

sun’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php
    @@ -51,21 +51,23 @@ class KeyValueFactory implements KeyValueFactoryInterface {
       protected $settings;
    ...
    -    $this->settings = $settings;
    +    $this->options = $options;
    

    Stale $settings class property name.

  2. +++ b/core/modules/simpletest/src/KernelTestBase.php
    @@ -260,7 +260,9 @@ public function containerBuild(ContainerBuilder $container) {
    +    $keyvalue_config = $container->getParameter('factory.keyvalue') ?: array();
    

    Can we rename this variable to $keyvalue_options?

    ("config" almost always means Config.)

  3. +++ b/core/modules/simpletest/src/KernelTestBase.php
    @@ -280,7 +282,7 @@ public function containerBuild(ContainerBuilder $container) {
    -        ->addArgument(new Reference('settings'));
    +        ->addArgument(new Parameter('factory.keyvalue'));
    

    Missing use statement for Parameter.

    Doesn't cause errors, because this code is wrapped into a condition that is obsolete and never TRUE in HEAD.

    So we can either remove the entire code + condition, or just add a use statement (if we want to avoid scope creep).

  4. +++ b/core/modules/simpletest/src/WebTestBase.php
    @@ -1022,6 +1025,26 @@ protected function writeSettings(array $settings) {
    +  protected function containerParameterSet($name, $value) {
    

    Can we rename this method to setContainerParameter()?

  5. +++ b/sites/default/default.services.yml
    @@ -0,0 +1,62 @@
    +    # Twig debugging:
    +    #
    +    # When debugging is enabled:
    +    # - The markup of each Twig template is surrounded by HTML comments that
    ...
    +    # Twig auto-reload:
    +    #
    +    # Automatically recompile Twig templates whenever the source code changes.
    ...
    +    # Twig cache:
    +    #
    +    # By default, Twig templates will be compiled and stored in the filesystem
    

    Unlike PHP in settings.php, excessively lengthy comments do negatively affect the YAML parser performance. (Next to harming DX.)

    In the first patch, I had heavily shortened these comments already. Was there a particular reason for reverting that?

    I don't think we should repeat the epic misery of settings.php comment novels. Instead, let's have minimum info inline + provide more help elsewhere — either in a separate file, or directly pointing to online documentation.

  6. +++ b/sites/default/default.services.yml
    @@ -0,0 +1,62 @@
    +    # Note: changes to this setting will only take effect once the cache is
    +    # cleared.
    ...
    +    # Note: changes to this setting will only take effect once the cache is
    +    # cleared.
    ...
    +    # Note: changes to this setting will only take effect once the cache is
    +    # cleared.
    

    In any case, these notes are unnecessary and should be removed.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new46.39 KB
new7.81 KB

Some good points. I have made changes for all of those points, except the shortening of the comments.

damiankloip’s picture

StatusFileSize
new43.88 KB

Somehow removed the default settings from the main patch.

damiankloip’s picture

StatusFileSize
new46.1 KB

Another missing file, sorry for noise!

+++ b/sites/default/default.services.yml
@@ -0,0 +1,53 @@
+    # Twig debugging:
+    #
+    # When debugging is enabled:
+    # - The markup of each Twig template is surrounded by HTML comments that
+    #   contain theming information, such as template file name suggestions.
+    # - Note that this debugging markup will cause automated tests that directly
+    #  check rendered HTML to fail. When running automated tests, 'twig_debug'
+    #   should be set to FALSE.
+    # - The dump() function can be used in Twig templates to output information
+    #   about template variables.
+    # - Twig templates are automatically recompiled whenever the source code
+    #  changes (see twig_auto_reload below).
+    #
+    # For more information about debugging Twig templates, see
+    # http://drupal.org/node/1906392.
+    #
+    # Not recommended in production environments
+    # @default false

I would also agree with @sun that comments like this seem a little on the verbose side for a yaml file.

dawehner’s picture

@sun
Thank you for the review, good points, indeed!

Unlike PHP in settings.php, excessively lengthy comments do negatively affect the YAML parser performance. (Next to harming DX.)

In the first patch, I had heavily shortened these comments already. Was there a particular reason for reverting that?

I don't think we should repeat the epic misery of settings.php comment novels. Instead, let's have minimum info inline + provide more help elsewhere — either in a separate file, or directly pointing to online documentation.

While I do agree in principal dropping that information without a proper replacement yet, is a bad idea. A follow up could move this documentation to drupal.org or somewhere else in the code #2322539: Improve (and shorten) documentation in default.services.yml.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

So back to RTBC

The last submitted patch, 45: 2251113-45.patch, failed testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 46: 2251113-46.patch, failed testing.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community

muh.

dawehner queued 46: 2251113-46.patch for re-testing.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/includes/install.core.inc
    @@ -1886,128 +1886,168 @@ function install_check_requirements($install_state) {
    +      // If settings.php does not exist, throw an error.
    ...
    +        // If settings.php is not readable, throw an error.
    ...
    +        // If settings.php is not writable, throw an error.
    

    If settings.php or services.yml...

  2. +++ b/core/modules/system/src/Tests/KeyValueStore/DatabaseStorageExpirableTest.php
    @@ -18,8 +19,9 @@ class DatabaseStorageExpirableTest extends StorageTestBase {
    -    module_load_install('system');
    +    include_once DRUPAL_ROOT . '/core/modules/system/system.install';
    
    +++ b/core/modules/system/src/Tests/KeyValueStore/DatabaseStorageTest.php
    @@ -18,7 +19,7 @@ class DatabaseStorageTest extends StorageTestBase {
    -    module_load_install('system');
    +    include_once DRUPAL_ROOT . '/core/modules/system/system.install';
    

    How come?

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new45.35 KB
new2.75 KB

How come?

Typical out of scope change.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

let's just re-RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 54: container_parameters-2251113-54.patch, failed testing.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community

It was green again.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Sorry for nitpicking a comment apart but this still does not feel right.

+++ b/core/INSTALL.txt
@@ -147,26 +147,30 @@ INSTALLATION
+      Drupal will try to automatically create a settings.php/services.yml
+      configuration file, which is normally in the directory sites/default (to
+      avoid problems when upgrading, Drupal is not packaged with this file). If
+      auto-creation fails, you will need to create this file yourself, using the
+      files sites/default/default.settings.php and
+      sites/default/default.services.yml as a template.

Should this not be something like: Drupal will try to automatically create settings.php and services.yml files, which are normally in the directory sites/default (to avoid problems when upgrading, Drupal is not packaged with this file). If auto-creation of either file fails, you will need to create the file yourself. Use the template sites/default/default.settings.php or sites/default/default.services.yml respectively.

sun’s picture

We could avoid most of the mumbo-jumbo in install.core.inc by maintaining the core-supplied default file in /core/default.services.yml.

Most of that utterly complex file copying code only exists, because default.settings.php is located in a directory that isn't supposed to contain any default files but is explicitly meant to contain your custom, site-specific code. Therefore, the installer wastes hundreds of lines of code to check whether the default file exists, perform a lame check to ensure it still contains the unmodified original code, ensure file permissions, throw ugly requirements errors, try to copy, and futz with permissions again.

For the same reason, the proposal in #1757536: Move settings.php to /settings directory, fold sites.php into settings.php moves default.settings.php into the /core directory, too.


Still not happy with the excessive verbosity and formatting of docs in default.services.yml. Don't want to block this issue on that though. Can we at least create a follow-up issue, so as to explicitly revisit them after commit?

sun’s picture

Regarding my second point - Apologies, I didn't recognize the link to #2322539: Improve (and shorten) documentation in default.services.yml in #47.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new1.18 KB
new45.35 KB

We could avoid most of the mumbo-jumbo in install.core.inc by maintaining the core-supplied default file in /core/default.services.yml.

Well, then you are back in having to merge the values when building the container right? Feel free to open a follow up.

Sorry for nitpicking a comment apart but this still does not feel right.

You can't be worse than the bot :P Just copy and pasted your solution. It sounded better to read.

sun’s picture

then you are back in having to merge the values when building the container right?

Nope, only the location of the source file differs:

-/sites/default/default.services.yml
+/core/default.services.yml

Still copied into /sites/$site/services.yml. Nothing is merged. But we avoid the hefty belly-dance in install.core.inc to assert that the default/source file hasn't been tampered with.

dawehner’s picture

@sun
Well your approach would certainly be nice as you would no longer have to figure out whether a default file exists etc. though you would have to either special case the logic
for the services.yml file, which is a bad idea, or move the default settings file as well, which feels like a good idea tbh. as long we have a good way to discover it.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

I guess we can move this back to RTBC now ?

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new19.93 KB
new46.15 KB

here is the lovely exception you get

Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service definition "logger.factory" does not exist. in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 873 of /Volumes/devdisk/dev/sites/drupal8alt.dev/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php).

Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition('logger.factory')
Symfony\Component\DependencyInjection\ContainerBuilder->get('logger.factory', 1)
Drupal\Core\DependencyInjection\ContainerBuilder->get('logger.factory')
Drupal::logger('php')
_drupal_log_error(Array, )
_drupal_error_handler_real(2, 'file_get_contents(sites/default/services.yml): failed to open stream: Permission denied', '/Volumes/devdisk/dev/sites/drupal8alt.dev/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php', 257, Array)
_drupal_error_handler(2, 'file_get_contents(sites/default/services.yml): failed to open stream: Permission denied', '/Volumes/devdisk/dev/sites/drupal8alt.dev/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php', 257, Array)
file_get_contents('sites/default/services.yml')
Drupal\Core\DependencyInjection\YamlFileLoader->loadFile('sites/default/services.yml')
Drupal\Core\DependencyInjection\YamlFileLoader->load('sites/default/services.yml')
Drupal\Core\DrupalKernel->compileContainer()
Drupal\Core\DrupalKernel->initializeContainer(1)
Drupal\Core\Installer\InstallerKernel->initializeContainer()
Drupal\Core\DrupalKernel->boot()
install_begin_request(Array)
install_drupal()

Patch attached tidies up some stuff and add important checking to system_requirements().

alexpott’s picture

I have not fixed the exception - you get it if you have a non writeable empty services.yml in place.

dawehner’s picture

Status: Needs work » Needs review

@alexpott
When exactly does that happen for you?
The patch does the exact some for the services file as for the settings.php file. Do you have some special way to run your installation?

here is the lovely exception you get

Well, the actual reason for that crazyness already exists without that patch: #2325385: Ensure that the error handler does not throw exception itself.

alexpott’s picture

Status: Needs review » Needs work

To recreate the exception:

  • sites/default is not writable by the webserver
  • sites/default/settings.php exists but is not writable by the webserver
  • sites/default/services.yml exists but is not writabel by the webserver

This should result in a requirement error.

alexpott’s picture

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new701 bytes
new46.83 KB
new55.29 KB

Wow, showing permissions feels almost like getting naked.

According to your description I tried to setup the directory and files:

├── [drwxr-xr-x dawehner dawehner]  default
│   ├── [-rw-rw-r-- dawehner dawehner]  default.services.yml
│   ├── [-rw-rw-r-- www-data www-data]  default.settings.php
│   ├── [drwxrwxrwx dawehner dawehner]  files
│   ├── [-rwxr-xr-x dawehner dawehner]  services.yml
│   ├── [-rw-r--r-- dawehner dawehner]  settings.local.php
│   └── [-rwxr-xr-x dawehner dawehner]  settings.php

It tells me that both services.yml and settings.php is not writable, as expected.

Sadly the code never wents into _drupal_log_error().

Looking bad at your exception all I needed to reproduce the issue is to drop the readable flag from the services file.
Now we just have to ensure that the kernel doesn't load a non-readable file. This results in a proper settings page, see screenshot.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

I was able to do a clean install with no issues, apart from #2306271: drupal_set_message(t('whatever')) is double escaped. Didn't spot any code issues in my review.

The DX of this looks like a big win. I've always hated the $settings vs. $config separation, because site builders shouldn't be expected to understand this level of sausage factory. I understand this patch doesn't get us all the way there, but it's a good step in the right direction. The docs improvements are welcome, as well.

One concern that was raised in IRC by beejeebus is the fact that rebuilding the container is an expensive operation, and particularly gnarly on a multi-web head environment with a shared filesystem. Originally it was apparently discussed to only do this during module install/uninstall to keep this pain down, but this will make it so we may do it at random times. ATM this doesn't feel like a commit-blocker, because the settings moved to container parameters in this patch are those you'd only want to change on a dev environment, where this would be less of an issue, generally. But something to keep in mind for future patches we try and use this pattern elsewhere.

In the meantime, committed and pushed to 8.x. Thanks!

  • webchick committed 4fb0f9d on 8.0.x
    Issue #2251113 by alexpott, damiankloip, Crell, Wim Leers, dawehner, sun...
star-szr’s picture

I just updated https://www.drupal.org/node/1922666, not sure if we want to update the timestamp on that one. Made a minor correction for the twig_debug default. I think someone with privileges can delete https://www.drupal.org/node/2317817 now.

And I published https://www.drupal.org/node/2317985 after making one minor tweak. Thanks @Wim Leers for writing both of those up!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.