core/INSTALL.txt | 17 ++++++----------- core/core.services.yml | 11 +++++++++-- core/includes/install.core.inc | 7 ------- core/lib/Drupal/Core/DrupalKernel.php | 17 ++++------------- core/lib/Drupal/Core/Installer/InstallerKernel.php | 7 ------- core/modules/simpletest/src/BrowserTestBase.php | 1 - core/modules/simpletest/src/WebTestBase.php | 1 - .../Core/DrupalKernel/DiscoverServiceProvidersTest.php | 12 +++++++++--- 8 files changed, 28 insertions(+), 45 deletions(-) diff --git a/core/INSTALL.txt b/core/INSTALL.txt index 514e528..a4b88ed 100644 --- a/core/INSTALL.txt +++ b/core/INSTALL.txt @@ -158,30 +158,26 @@ INSTALLATION b. Missing settings file. - 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. + Drupal will try to automatically create a settings.php 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 file + sites/default/default.settings.php as a template. For example, on a Unix/Linux command line, you can make a copy of the - default.settings.php and default.services.yml files with the commands: + default.settings.php file with the command: cp sites/default/default.settings.php sites/default/settings.php - cp sites/default/default.services.yml sites/default/services.yml Next, grant write privileges to the file to everyone (including the web server) with the command: chmod a+w sites/default/settings.php - chmod a+w sites/default/services.yml Be sure to set the permissions back after the installation is finished! Sample command: chmod go-w sites/default/settings.php - chmod go-w sites/default/services.yml c. Write permissions after install. @@ -191,7 +187,6 @@ INSTALLATION from a Unix/Linux command line: chmod go-w sites/default/settings.php - chmod go-w sites/default/services.yml chmod go-w sites/default 4. Verify that the site is working. diff --git a/core/core.services.yml b/core/core.services.yml index 9d40627..e5ca734 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -1,6 +1,13 @@ parameters: - session.storage.options: {} - twig.config: {} + session.storage.options: + gc_probability: 1 + gc_divisor: 100 + gc_maxlifetime: 200000 + cookie_lifetime: 2000000 + twig.config: + debug: false + auto_reload: null + cache: true renderer.config: required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions'] auto_placeholder_conditions: diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index db35fd7..3b4c4ab 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -2092,13 +2092,6 @@ function install_check_requirements($install_state) { 'description_default' => t('The default settings file does not exist.'), 'title' => t('Settings file'), ); - $default_files['services.yml'] = array( - 'file' => 'services.yml', - 'file_default' => 'default.services.yml', - 'title_default' => t('Default services file'), - 'description_default' => t('The default services file does not exist.'), - 'title' => t('Services file'), - ); foreach ($default_files as $default_file_info) { $readable = FALSE; diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index 4747440..984ab78 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -519,9 +519,7 @@ public function discoverServiceProviders() { } } } - if (!$this->addServiceFiles(Settings::get('container_yamls'))) { - throw new \Exception('The container_yamls setting is missing from settings.php'); - } + $this->addServiceFiles(Settings::get('container_yamls', [])); } /** @@ -1413,17 +1411,10 @@ protected static function setupTrustedHosts(Request $request, $host_patterns) { /** * Add service files. * - * @param $service_yamls + * @param string[] $service_yamls * A list of service files. - * - * @return bool - * TRUE if the list was an array, FALSE otherwise. */ - protected function addServiceFiles($service_yamls) { - if (is_array($service_yamls)) { - $this->serviceYamls['site'] = array_filter($service_yamls, 'file_exists'); - return TRUE; - } - return FALSE; + protected function addServiceFiles(array $service_yamls) { + $this->serviceYamls['site'] = array_filter($service_yamls, 'file_exists'); } } diff --git a/core/lib/Drupal/Core/Installer/InstallerKernel.php b/core/lib/Drupal/Core/Installer/InstallerKernel.php index cd3977c..a00febf 100644 --- a/core/lib/Drupal/Core/Installer/InstallerKernel.php +++ b/core/lib/Drupal/Core/Installer/InstallerKernel.php @@ -38,11 +38,4 @@ public function resetConfigStorage() { $this->configStorage = NULL; } - /** - * {@inheritdoc} - */ - protected function addServiceFiles($service_yamls) { - // In the beginning there is no settings.php and no service YAMLs. - return parent::addServiceFiles($service_yamls ?: []); - } } diff --git a/core/modules/simpletest/src/BrowserTestBase.php b/core/modules/simpletest/src/BrowserTestBase.php index b37a681..df486d9 100644 --- a/core/modules/simpletest/src/BrowserTestBase.php +++ b/core/modules/simpletest/src/BrowserTestBase.php @@ -843,7 +843,6 @@ public function installDrupal() { // Not using File API; a potential error must trigger a PHP warning. $directory = DRUPAL_ROOT . '/' . $this->siteDirectory; copy(DRUPAL_ROOT . '/sites/default/default.settings.php', $directory . '/settings.php'); - copy(DRUPAL_ROOT . '/sites/default/default.services.yml', $directory . '/services.yml'); // All file system paths are created by System module during installation. // @see system_requirements() diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index b4ebe73..e9a2685 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -711,7 +711,6 @@ protected function prepareSettings() { // Not using File API; a potential error must trigger a PHP warning. $directory = DRUPAL_ROOT . '/' . $this->siteDirectory; copy(DRUPAL_ROOT . '/sites/default/default.settings.php', $directory . '/settings.php'); - copy(DRUPAL_ROOT . '/sites/default/default.services.yml', $directory . '/services.yml'); // All file system paths are created by System module during installation. // @see system_requirements() diff --git a/core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php b/core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php index 6162790..c955b58 100644 --- a/core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php +++ b/core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php @@ -46,14 +46,20 @@ public function testDiscoverServiceCustom() { /** * Tests the exception when container_yamls is not set. - * - * @covers ::discoverServiceProviders - * @expectedException \Exception */ public function testDiscoverServiceNoContainerYamls() { new Settings([]); $kernel = new DrupalKernel('prod', new \Composer\Autoload\ClassLoader()); $kernel->discoverServiceProviders(); + + $expect = [ + 'app' => [ + 'core' => 'core/core.services.yml', + ], + 'site' => [ + ], + ]; + $this->assertAttributeSame($expect, 'serviceYamls', $kernel); } }