Skip to content

Commit a7a3d6c

Browse files
committed
Update scaffold to 8.0.0-beta12
1 parent b0ea906 commit a7a3d6c

File tree

11 files changed

+106
-71
lines changed

11 files changed

+106
-71
lines changed

web/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ sites/**/files/**/*
55
libraries/**/*
66
sites/**/libraries/**/*
77
profiles/**/libraries/**/*
8+
**/js_test_files/**/*

web/.eslintrc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
"comma-style": [2, "last"],
2222
"eqeqeq": [2, "smart"],
2323
"guard-for-in": 2,
24+
"indent": [2, 2, {"indentSwitchCase": true}],
2425
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
26+
"lines-around-comment": [2, {"beforeBlockComment": true, "afterBlockComment": false}],
2527
"no-implied-eval": 2,
2628
"no-mixed-spaces-and-tabs": 2,
2729
"no-nested-ternary": 2,
@@ -30,15 +32,24 @@
3032
"no-undef": 2,
3133
"no-undefined": 2,
3234
"no-unused-vars": [2, {"vars": "local", "args": "none"}],
35+
"one-var": [2, "never"],
3336
"semi": [2, "always"],
34-
"space-after-keywords": [2, "always", {"checkFunctionKeyword": true}],
37+
"space-after-keywords": [2, "always"],
3538
"space-before-blocks": [2, "always"],
39+
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
3640
"space-in-brackets": [2, "never"],
3741
"space-in-parens": [2, "never"],
3842
"spaced-line-comment": [2, "always"],
3943
"strict": 2,
4044
// Warnings.
4145
"max-nested-callbacks": [1, 3],
46+
"valid-jsdoc": [1, {
47+
"prefer": {
48+
"returns": "return",
49+
"property": "prop"
50+
},
51+
"requireReturn": false
52+
}],
4253
// Disabled.
4354
"camelcase": 0,
4455
"consistent-return": 0,

web/.gitattributes

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Drupal git normalization
2-
# @see http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3-
# @see http://drupal.org/node/1542048
2+
# @see https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
# @see https://www.drupal.org/node/1542048
44

55
# Normally these settings would be done with macro attributes for improved
66
# readability and easier maintenance. However macros can only be defined at the
@@ -50,3 +50,4 @@
5050
*.jpg -text diff
5151
*.png -text diff
5252
*.phar -text diff
53+
*.exe -text diff

web/.htaccess

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
# Protect files and directories from prying eyes.
6-
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
6+
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
77
<IfModule mod_authz_core.c>
88
Require all denied
99
</IfModule>
@@ -24,6 +24,10 @@ ErrorDocument 404 /index.php
2424
# Set the default handler.
2525
DirectoryIndex index.php index.html index.htm
2626

27+
# Add correct encoding for SVGZ.
28+
AddType image/svg+xml svg svgz
29+
AddEncoding gzip svgz
30+
2731
# Override PHP settings that cannot be changed at runtime. See
2832
# sites/default/default.settings.php and
2933
# Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be
@@ -35,6 +39,9 @@ DirectoryIndex index.php index.html index.htm
3539
php_value mbstring.http_input pass
3640
php_value mbstring.http_output pass
3741
php_flag mbstring.encoding_translation off
42+
# PHP 5.6 has deprecated $HTTP_RAW_POST_DATA and produces warnings if this is
43+
# not set.
44+
php_value always_populate_raw_post_data -1
3845
</IfModule>
3946

4047
# Requires mod_expires to be enabled.
@@ -90,14 +97,14 @@ DirectoryIndex index.php index.html index.htm
9097
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
9198
#
9299
# To redirect all users to access the site WITH the 'www.' prefix,
93-
# (http://example.com/... will be redirected to http://www.example.com/...)
100+
# (http://example.com/foo will be redirected to http://www.example.com/foo)
94101
# uncomment the following:
95102
# RewriteCond %{HTTP_HOST} .
96103
# RewriteCond %{HTTP_HOST} !^www\. [NC]
97104
# RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
98105
#
99106
# To redirect all users to access the site WITHOUT the 'www.' prefix,
100-
# (http://www.example.com/... will be redirected to http://example.com/...)
107+
# (http://www.example.com/foo will be redirected to http://example.com/foo)
101108
# uncomment the following:
102109
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
103110
# RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]
@@ -132,13 +139,14 @@ DirectoryIndex index.php index.html index.htm
132139
# Allow access to PHP files in /core (like authorize.php or install.php):
133140
RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$
134141
# Allow access to test-specific PHP files:
135-
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?.php$
142+
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?.php
136143
# Allow access to Statistics module's custom front controller.
137144
# Copy and adapt this rule to directly execute PHP files in contributed or
138145
# custom modules or to run another PHP application in the same directory.
139146
RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$
140147
# Deny access to any other PHP files that do not match the rules above.
141-
RewriteRule "^.+/.*\.php$" - [F]
148+
# Specifically, disallow autoload.php from being served directly.
149+
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]
142150

143151
# Rules to correctly serve gzip compressed CSS and JS files.
144152
# Requires both mod_rewrite and mod_headers to be enabled.

web/index.php

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,14 @@
99
*/
1010

1111
use Drupal\Core\DrupalKernel;
12-
use Drupal\Core\Site\Settings;
13-
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
1412
use Symfony\Component\HttpFoundation\Request;
15-
use Symfony\Component\HttpFoundation\Response;
1613

1714
$autoloader = require_once 'autoload.php';
1815

19-
try {
16+
$kernel = new DrupalKernel('prod', $autoloader);
2017

21-
$request = Request::createFromGlobals();
22-
$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod');
23-
$response = $kernel
24-
->handle($request)
25-
// Handle the response object.
26-
->prepare($request)->send();
27-
$kernel->terminate($request, $response);
28-
}
29-
catch (HttpExceptionInterface $e) {
30-
$response = new Response($e->getMessage(), $e->getStatusCode());
31-
$response->prepare($request)->send();
32-
}
33-
catch (Exception $e) {
34-
$message = 'If you have just changed code (for example deployed a new module or moved an existing one) read <a href="http://drupal.org/documentation/rebuild">http://drupal.org/documentation/rebuild</a>';
35-
if (Settings::get('rebuild_access', FALSE)) {
36-
$rebuild_path = $GLOBALS['base_url'] . '/rebuild.php';
37-
$message .= " or run the <a href=\"$rebuild_path\">rebuild script</a>";
38-
}
18+
$request = Request::createFromGlobals();
19+
$response = $kernel->handle($request);
20+
$response->send();
3921

40-
// Set the response code manually. Otherwise, this response will default to a
41-
// 200.
42-
http_response_code(500);
43-
print $message;
44-
throw $e;
45-
}
22+
$kernel->terminate($request, $response);

web/robots.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@
1212
#
1313
# For more information about the robots.txt standard, see:
1414
# http://www.robotstxt.org/robotstxt.html
15-
#
16-
# For syntax checking, see:
17-
# http://www.frobee.com/robots-txt-check
1815

1916
User-agent: *
20-
Crawl-delay: 10
2117
# JS/CSS
2218
Allow: /core/*.css$
2319
Allow: /core/*.js$

web/sites/default/default.services.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ parameters:
2525
cookie_lifetime: 2000000
2626
#
2727
# Drupal automatically generates a unique session cookie name based on the
28-
# full domain name used to access the site. This mechanism is sufficent for
29-
# most use-cases, including multi-site deployments. However, if it is
30-
# desired that a session can be reused accross different subdomains, the
28+
# full domain name used to access the site. This mechanism is sufficient
29+
# for most use-cases, including multi-site deployments. However, if it is
30+
# desired that a session can be reused across different subdomains, the
3131
# cookie domain needs to be set to the shared base domain. Doing so assures
3232
# that users remain logged in as they cross between various subdomains.
3333
# To maximize compatibility and normalize the behavior across user agents,
@@ -51,7 +51,7 @@ parameters:
5151
# changes (see auto_reload below).
5252
#
5353
# For more information about debugging Twig templates, see
54-
# http://drupal.org/node/1906392.
54+
# https://www.drupal.org/node/1906392.
5555
#
5656
# Not recommended in production environments
5757
# @default false
@@ -76,6 +76,14 @@ parameters:
7676
# Not recommended in production environments
7777
# @default true
7878
cache: true
79+
renderer.config:
80+
# Renderer required cache contexts:
81+
#
82+
# The Renderer will automatically associate these cache contexts with every
83+
# render array, hence varying every render array by these cache contexts.
84+
#
85+
# @default ['languages:language_interface', 'theme']
86+
required_cache_contexts: ['languages:language_interface', 'theme']
7987
factory.keyvalue:
8088
{}
8189
# Default key/value storage service to use.

web/sites/default/default.settings.php

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* 'sites/default' will be used.
2323
*
2424
* For example, for a fictitious site installed at
25-
* http://www.drupal.org:8080/mysite/test/, the 'settings.php' file is searched
25+
* https://www.drupal.org:8080/mysite/test/, the 'settings.php' file is searched
2626
* for in the following directories:
2727
*
2828
* - sites/8080.www.drupal.org.mysite.test
@@ -44,11 +44,11 @@
4444
*
4545
* Note that if you are installing on a non-standard port number, prefix the
4646
* hostname with that number. For example,
47-
* http://www.drupal.org:8080/mysite/test/ could be loaded from
47+
* https://www.drupal.org:8080/mysite/test/ could be loaded from
4848
* sites/8080.www.drupal.org.mysite.test/.
4949
*
5050
* @see example.sites.php
51-
* @see conf_path()
51+
* @see \Drupal\Core\DrupalKernel::getSitePath()
5252
*
5353
* In addition to customizing application settings through variables in
5454
* settings.php, you can create a services.yml file in the same directory to
@@ -75,7 +75,7 @@
7575
* 'host' => 'localhost',
7676
* 'port' => 3306,
7777
* 'prefix' => 'myprefix_',
78-
* 'collation' => 'utf8_general_ci',
78+
* 'collation' => 'utf8mb4_general_ci',
7979
* );
8080
* @endcode
8181
*
@@ -127,7 +127,7 @@
127127
* 'password' => 'password',
128128
* 'host' => 'localhost',
129129
* 'prefix' => 'main_',
130-
* 'collation' => 'utf8_general_ci',
130+
* 'collation' => 'utf8mb4_general_ci',
131131
* );
132132
* @endcode
133133
*
@@ -255,6 +255,18 @@
255255
* @see \Drupal\Core\Site\Settings::get()
256256
*/
257257

258+
/**
259+
* The active installation profile.
260+
*
261+
* Changing this after installation is not recommended as it changes which
262+
* directories are scanned during extension discovery. If this is set prior to
263+
* installation this value will be rewritten according to the profile selected
264+
* by the user.
265+
*
266+
* @see install_select_profile()
267+
*/
268+
# $settings['install_profile'] = '';
269+
258270
/**
259271
* Salt for one-time login links, cancel links, form tokens, etc.
260272
*
@@ -274,6 +286,16 @@
274286
*/
275287
$settings['hash_salt'] = '';
276288

289+
/**
290+
* Deployment identifier.
291+
*
292+
* Drupal's dependency injection container will be automatically invalidated and
293+
* rebuilt when the Drupal core version changes. When updating contributed or
294+
* custom code that changes the container, changing this identifier will also
295+
* allow the container to be invalidated as soon as code is deployed.
296+
*/
297+
# $settings['deployment_identifier'] = \Drupal::VERSION;
298+
277299
/**
278300
* Access control for update.php script.
279301
*
@@ -371,18 +393,29 @@
371393
/**
372394
* Class Loader.
373395
*
374-
* By default, Composer's ClassLoader is used, which is best for development, as
375-
* it does not break when code is moved in the file system. You can decorate the
376-
* class loader with a cached solution for better performance, which is
377-
* recommended for production sites.
378-
*
379-
* To do so, you may decorate and replace the local $class_loader variable.
380-
*
381-
* For example, to use Symfony's APC class loader, uncomment the code below.
396+
* If the APC extension is detected, the Symfony APC class loader is used for
397+
* performance reasons. Detection can be prevented by setting
398+
* class_loader_auto_detect to false, as in the example below.
399+
*/
400+
# $settings['class_loader_auto_detect'] = FALSE;
401+
402+
/*
403+
* If the APC extension is not detected, either because APC is missing or
404+
* because auto-detection has been disabled, auto-loading falls back to
405+
* Composer's ClassLoader, which is good for development as it does not break
406+
* when code is moved in the file system. You can also decorate the base class
407+
* loader with another cached solution than the Symfony APC class loader, as
408+
* all production sites should have a cached class loader of some sort enabled.
409+
*
410+
* To do so, you may decorate and replace the local $class_loader variable. For
411+
* example, to use Symfony's APC class loader without automatic detection,
412+
* uncomment the code below.
382413
*/
383414
/*
384415
if ($settings['hash_salt']) {
385-
$apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader('drupal.' . $settings['hash_salt'], $class_loader);
416+
$prefix = 'drupal.' . hash('sha256', 'drupal.' . $settings['hash_salt']);
417+
$apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $class_loader);
418+
unset($prefix);
386419
$class_loader->unregister();
387420
$apc_loader->register();
388421
$class_loader = $apc_loader;
@@ -407,7 +440,7 @@
407440
* the code directly via SSH or FTP themselves. This setting completely
408441
* disables all functionality related to these authorized file operations.
409442
*
410-
* @see http://drupal.org/node/244924
443+
* @see https://www.drupal.org/node/244924
411444
*
412445
* Remove the leading hash signs to disable.
413446
*/
@@ -434,14 +467,14 @@
434467
* Private file path:
435468
*
436469
* A local file system path where private files will be stored. This directory
437-
* must be absolute, outside of the the Drupal installation directory and not
470+
* must be absolute, outside of the Drupal installation directory and not
438471
* accessible over the web.
439472
*
440473
* Note: Caches need to be cleared when this value is changed to make the
441474
* private:// stream wrapper available to the system.
442475
*
443-
* See http://drupal.org/documentation/modules/file for more information about
444-
* securing private files.
476+
* See https://www.drupal.org/documentation/modules/file for more information
477+
* about securing private files.
445478
*/
446479
# $settings['file_private_path'] = '';
447480

web/sites/example.settings.local.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
$config['system.performance']['js']['preprocess'] = FALSE;
2929

3030
/**
31-
* Disable the render cache.
31+
* Disable the render cache (this includes the page cache).
3232
*
3333
* This setting disables the render cache by using the Null cache back-end
3434
* defined by the development.services.yml file above.

web/sites/example.sites.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121
*
2222
* Aliases are defined in an associative array named $sites. The array is
2323
* written in the format: '<port>.<domain>.<path>' => 'directory'. As an
24-
* example, to map http://www.drupal.org:8080/mysite/test to the configuration
24+
* example, to map https://www.drupal.org:8080/mysite/test to the configuration
2525
* directory sites/example.com, the array should be defined as:
2626
* @code
2727
* $sites = array(
2828
* '8080.www.drupal.org.mysite.test' => 'example.com',
2929
* );
3030
* @endcode
31-
* The URL, http://www.drupal.org:8080/mysite/test/, could be a symbolic link or
32-
* an Apache Alias directive that points to the Drupal root containing
31+
* The URL, https://www.drupal.org:8080/mysite/test/, could be a symbolic link
32+
* or an Apache Alias directive that points to the Drupal root containing
3333
* index.php. An alias could also be created for a subdomain. See the
34-
* @link http://drupal.org/documentation/install online Drupal installation guide @endlink
34+
* @link https://www.drupal.org/documentation/install online Drupal installation guide @endlink
3535
* for more information on setting up domains, subdomains, and subdirectories.
3636
*
3737
* The following examples look for a site configuration in sites/example.com:
@@ -45,11 +45,11 @@
4545
* URL: http://localhost:8080/example
4646
* $sites['8080.localhost.example'] = 'example.com';
4747
*
48-
* URL: http://www.drupal.org:8080/mysite/test/
48+
* URL: https://www.drupal.org:8080/mysite/test/
4949
* $sites['8080.www.drupal.org.mysite.test'] = 'example.com';
5050
* @endcode
5151
*
5252
* @see default.settings.php
5353
* @see conf_path()
54-
* @see http://drupal.org/documentation/install/multi-site
54+
* @see https://www.drupal.org/documentation/install/multi-site
5555
*/

0 commit comments

Comments
 (0)