diff --git a/core/INSTALL.txt b/core/INSTALL.txt index 514e528fec7a822f3cac80fd52443c784b7de91e..a4b88edbcd8c52b170daf7e02755db873df332f2 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 bc94ced637137f0ccd63fe7811c5830db935fa19..1aadb75f0c07c054d1c4574b3580209843801e6f 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 db35fd7216b92f1b318ba7ce04ced3ad3ee6a30c..3b4c4abe75fdc87775e8c7d9fe0ce189729dd715 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 cd0c19e8de94a28457989473edb6c7c0d3e60f01..89a77e1de8fbdb2c6bbdaeec1f7911f122604e62 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -538,9 +538,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', [])); } /** @@ -1445,17 +1443,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 cd3977cf3debf34db3308af29c88fcc5144e26bf..a00febf8179213fe81118a9c75fa953c299b8d97 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 e5967b85769d038291cbb5bb64dcb3d9adfa2261..42244217ae38389e01949cc7e4f1256f8784a1d9 100644 --- a/core/modules/simpletest/src/BrowserTestBase.php +++ b/core/modules/simpletest/src/BrowserTestBase.php @@ -842,7 +842,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 cfccbcf044b872a63f2d59e32220c2e34d2448ca..7d2a7aefb1106c17168853b73783585e859e7080 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() @@ -753,10 +752,12 @@ protected function prepareSettings() { file_put_contents($directory . '/settings.php', "\n\$test_class = '" . get_class($this) ."';\n" . 'include DRUPAL_ROOT . \'/\' . $site_path . \'/settings.testing.php\';' ."\n", FILE_APPEND); } $settings_services_file = DRUPAL_ROOT . '/' . $this->originalSite . '/testing.services.yml'; - if (file_exists($settings_services_file)) { - // Copy the testing-specific service overrides in place. - copy($settings_services_file, $directory . '/services.yml'); + if (!file_exists($settings_services_file)) { + // Otherwise, use the default services as a starting point for overrides. + $settings_services_file = DRUPAL_ROOT . '/sites/default/default.services.yml'; } + // Copy the testing-specific service overrides in place. + copy($settings_services_file, $directory . '/services.yml'); if ($this->strictConfigSchema) { // Add a listener to validate configuration schema on save. $yaml = new \Symfony\Component\Yaml\Yaml(); diff --git a/core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php b/core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php index 616279013863af5a5cd0beb703abcc6124a5bb56..c955b58924f72c9e473390f36a84b5a425a1d38b 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); } }