Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
222
Merge Requests
222
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
ba2268f0
Commit
ba2268f0
authored
Aug 21, 2015
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2547447
by Wim Leers, dawehner: Stop creating services.yml by default
parent
c7ca868d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
48 deletions
+33
-48
core/INSTALL.txt
core/INSTALL.txt
+6
-11
core/core.services.yml
core/core.services.yml
+9
-2
core/includes/install.core.inc
core/includes/install.core.inc
+0
-7
core/lib/Drupal/Core/DrupalKernel.php
core/lib/Drupal/Core/DrupalKernel.php
+4
-13
core/lib/Drupal/Core/Installer/InstallerKernel.php
core/lib/Drupal/Core/Installer/InstallerKernel.php
+0
-7
core/modules/simpletest/src/BrowserTestBase.php
core/modules/simpletest/src/BrowserTestBase.php
+0
-1
core/modules/simpletest/src/WebTestBase.php
core/modules/simpletest/src/WebTestBase.php
+5
-4
core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php
.../Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php
+9
-3
No files found.
core/INSTALL.txt
View file @
ba2268f0
...
...
@@ -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.
...
...
core/core.services.yml
View file @
ba2268f0
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
:
...
...
core/includes/install.core.inc
View file @
ba2268f0
...
...
@@ -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
;
...
...
core/lib/Drupal/Core/DrupalKernel.php
View file @
ba2268f0
...
...
@@ -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'
);
}
}
core/lib/Drupal/Core/Installer/InstallerKernel.php
View file @
ba2268f0
...
...
@@ -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
?:
[]);
}
}
core/modules/simpletest/src/BrowserTestBase.php
View file @
ba2268f0
...
...
@@ -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()
...
...
core/modules/simpletest/src/WebTestBase.php
View file @
ba2268f0
...
...
@@ -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
();
...
...
core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php
View file @
ba2268f0
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment