updated to 9.5 & php 8.1

This commit is contained in:
2024-03-02 22:49:01 +01:00
parent c95420bb28
commit 33f8f97e1a
15605 changed files with 3123 additions and 1692608 deletions
+8 -8
View File
@@ -19,24 +19,24 @@
*.config text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.css text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.dist text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
*.html text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=html
*.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
*.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
*.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.map text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
*.po text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
*.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
*.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.svg text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
*.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
+50 -13
View File
@@ -1,17 +1,54 @@
vendor
vendor/*
vendor/.*
# Ignore directories generated by Composer
/drush/contrib/
/vendor/
/web/core/
/web/modules/contrib/
/web/themes/contrib/
/web/profiles/contrib/
/web/libraries/
# Ignore sensitive information
/web/sites/*/settings.php
/web/sites/*/settings.local.php
/web/sites/*/services*.yml
/web/sites/*/salt.txt
/web/sites/development.services.yml
web/sites/example.settings.local.php
web/sites/example.sites.php
web/modules/contrib/*
web/themes/contrib/*
web/sites/default/files/*
web/sites/default/files/.*
web/sites/default/settings.php
web/sites/*/files
web/sites/development.services.yml
web/sites/development.services.yml
web/sites/default/online_settings.php
web/.htaccess
/web/sites/default/development.services.yml
# Ignore Drupal's file directory
/web/sites/*/files/
# Ignore SimpleTest multi-site environment.
/web/sites/simpletest
# Ignore files generated by PhpStorm
/.idea/
# Ignore .env files as they are personal
/.env
# npm
node_modules/
*.patch
.csslintrc
.eslintrc.json
.ht.router.php
.htaccess
INSTALL.txt
README.txt
autoload.php
example.gitignore
index.php
#/robots.txt
update.php
web.config
web/README.md
web/robots.txt
web/.vscode/*
.vscode/*
web/themes/custom/popsu_colloque/node_modules/*
web/themes/custom/popsu_colloque/node_modules/.*
+27 -19
View File
@@ -16,45 +16,52 @@
],
"require": {
"composer/installers": "^1.2",
"drupal/address": "^1.8",
"drupal/address_map_link": "^1.0",
"drupal/address": "^2.0",
"drupal/address_map_link": "^1.4",
"drupal/audiofield": "^1.9",
"drupal/backup_migrate": "^4.1",
"drupal/core-composer-scaffold": "^8.8",
"drupal/core-recommended": "^8.8",
"drupal/entity_browser_enhanced": "^1.0",
"drupal/backup_migrate": "^5.0",
"drupal/charts": "^5.0",
"drupal/core-composer-scaffold": "^9.5",
"drupal/core-project-message": "^9.5",
"drupal/core-recommended": "^9.5",
"drupal/ctools": "^4.0",
"drupal/entity_browser": "^2.10",
"drupal/entity_browser_enhanced": "^2.0",
"drupal/entity_reference_revisions": "^1.11",
"drupal/field_group": "^3.0",
"drupal/field_pager": "^2.0@beta",
"drupal/field_token_value": "^1.0",
"drupal/geocoder": "^3.7",
"drupal/field_token_value": "^3.0",
"drupal/geofield": "^1.15",
"drupal/geofield_map": "^2.66",
"drupal/geolocation": "^3.2",
"drupal/jquery_ui": "^1.6",
"drupal/jquery_ui_draggable": "^2.0",
"drupal/jquery_ui_droppable": "^2.0",
"drupal/leaflet": "^1.41",
"drupal/linkit": "^4.3",
"drupal/linkit": "^6.0",
"drupal/masonry": "^4.0",
"drupal/matomo": "^1.11",
"drupal/mediteran": "^1.10",
"drupal/metatag": "^1.13",
"drupal/page_manager": "^4.0",
"drupal/panels": "^4.7",
"drupal/paragraphs": "^1.12",
"drupal/pathauto": "^1.8",
"drupal/redirect": "^1.6",
"drupal/redirect_after_login": "^2.6",
"drupal/redis": "^1.4",
"drupal/schema_metatag": "^1.5",
"drupal/schema_metatag": "^2.5",
"drupal/search_api": "^1.18",
"drupal/site_settings": "^1.19",
"drupal/subpathauto": "^1.1",
"drupal/tacjs": "^3.9",
"drupal/time_range": "^8.1",
"drupal/transliterate_filenames": "^1.4",
"drupal/varbase_total_control": "^6.11",
"drupal/tacjs": "^6.4",
"drupal/time_range": "^9.0",
"drupal/token": "^1.13",
"drupal/transliterate_filenames": "^2.0",
"drupal/varbase_total_control": "^9.0",
"drupal/video_embed_field": "^2.4",
"drupal/views_infinite_scroll": "^1.7",
"drupal/views_url_path_arguments": "^1.1",
"drush/drush": "^10.2",
"geocoder-php/chain-provider": "^4.2",
"geocoder-php/google-maps-provider": "^4.5",
"sierrafayad/osm-pbf": "^1.0",
"twbs/bootstrap": "4.5.0"
},
"conflict": {
@@ -68,7 +75,8 @@
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"cweagans/composer-patches": true,
"oomphinc/composer-installers-extender": true
"oomphinc/composer-installers-extender": true,
"drupal/core-project-message": true
}
},
"extra": {
Generated
+3037 -3570
View File
File diff suppressed because it is too large Load Diff
-65
View File
@@ -1,65 +0,0 @@
<?php
/**
* @file
* Router script for the built-in PHP web server.
*
* The built-in web server should only be used for development and testing as it
* has a number of limitations that makes running Drupal on it highly insecure
* and somewhat limited.
*
* Note that:
* - The server is single-threaded, any requests made during the execution of
* the main request will hang until the main request has been completed.
* - The web server does not enforce any of the settings in .htaccess in
* particular a remote user will be able to download files that normally would
* be protected from direct access such as .module files.
*
* The router script is needed to work around a bug in PHP, see
* https://bugs.php.net/bug.php?id=61286.
*
* Usage:
* php -S localhost:8888 .ht.router.php
*
* @see http://php.net/manual/en/features.commandline.webserver.php
*/
$url = parse_url($_SERVER['REQUEST_URI']);
if (file_exists(__DIR__ . $url['path'])) {
// Serve the requested resource as-is.
return FALSE;
}
// Work around the PHP bug.
$path = $url['path'];
$script = 'index.php';
if (strpos($path, '.php') !== FALSE) {
// Work backwards through the path to check if a script exists. Otherwise
// fallback to index.php.
do {
$path = dirname($path);
if (preg_match('/\.php$/', $path) && is_file(__DIR__ . $path)) {
// Discovered that the path contains an existing PHP file. Use that as the
// script to include.
$script = ltrim($path, '/');
break;
}
} while ($path !== '/' && $path !== '.');
}
// Update $_SERVER variables to point to the correct index-file.
$index_file_absolute = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $script;
$index_file_relative = DIRECTORY_SEPARATOR . $script;
// SCRIPT_FILENAME will point to the router script itself, it should point to
// the full path of index.php.
$_SERVER['SCRIPT_FILENAME'] = $index_file_absolute;
// SCRIPT_NAME and PHP_SELF will either point to index.php or contain the full
// virtual path being requested depending on the URL being requested. They
// should always point to index.php relative to document root.
$_SERVER['SCRIPT_NAME'] = $index_file_relative;
$_SERVER['PHP_SELF'] = $index_file_relative;
// Require the script and let core take over.
require $_SERVER['SCRIPT_FILENAME'];
-182
View File
@@ -1,182 +0,0 @@
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
</IfModule>
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Set the default handler.
DirectoryIndex index.php index.html index.htm
# Add correct encoding for SVGZ.
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
# Most of the following PHP settings cannot be changed at runtime. See
# sites/default/default.settings.php and
# Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be
# changed at runtime.
# PHP 7, Apache 1 and 2.
<IfModule mod_php7.c>
php_value assert.active 0
</IfModule>
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
<FilesMatch \.php$>
# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off
</FilesMatch>
</IfModule>
# Set a fallback resource if mod_rewrite is not enabled. This allows Drupal to
# work without clean URLs. This requires Apache version >= 2.2.16. If Drupal is
# not accessed by the top level URL (i.e.: http://example.com/drupal/ instead of
# http://example.com/), the path to index.php will need to be adjusted.
<IfModule !mod_rewrite.c>
FallbackResource /index.php
</IfModule>
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# Set "protossl" to "s" if we were accessed via https://. This is used later
# if you enable "www." stripping or enforcement, in order to ensure that
# you don't bounce between http and https.
RewriteRule ^ - [E=protossl]
RewriteCond %{HTTPS} on
RewriteRule ^ - [E=protossl:s]
# Make sure Authorization HTTP header is available to PHP
# even when running as CGI or FastCGI.
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Block access to "hidden" directories whose names begin with a period. This
# includes directories used by version control systems such as Subversion or
# Git to store control files. Files whose names begin with a period, as well
# as the control files used by CVS, are protected by the FilesMatch directive
# above.
#
# NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
# not possible to block access to entire directories from .htaccess because
# <DirectoryMatch> is not allowed here.
#
# If you do not have mod_rewrite installed, you should remove these
# directories from your webroot or otherwise protect them from being
# downloaded.
RewriteRule "/\.|^\.(?!well-known/)" - [F]
# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/foo will be redirected to http://www.example.com/foo)
# uncomment the following:
# RewriteCond %{HTTP_HOST} .
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/foo will be redirected to http://example.com/foo)
# uncomment the following:
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
# Redirect common PHP files to their new locations.
RewriteCond %{REQUEST_URI} ^(.*)?/(install.php) [OR]
RewriteCond %{REQUEST_URI} ^(.*)?/(rebuild.php)
RewriteCond %{REQUEST_URI} !core
RewriteRule ^ %1/core/%2 [L,QSA,R=301]
# Rewrite install.php during installation to see if mod_rewrite is working
RewriteRule ^core/install.php core/install.php?rewrite=ok [QSA,L]
# Pass all requests not referring directly to files in the filesystem to
# index.php.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
# For security reasons, deny access to other PHP files on public sites.
# Note: The following URI conditions are not anchored at the start (^),
# because Drupal may be located in a subdirectory. To further improve
# security, you can replace '!/' with '!^/'.
# Allow access to PHP files in /core (like authorize.php or install.php):
RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$
# Allow access to test-specific PHP files:
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?.php
# Allow access to Statistics module's custom front controller.
# Copy and adapt this rule to directly execute PHP files in contributed or
# custom modules or to run another PHP application in the same directory.
RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$
# Deny access to any other PHP files that do not match the rules above.
# Specifically, disallow autoload.php from being served directly.
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]
# Rules to correctly serve gzip compressed CSS and JS files.
# Requires both mod_rewrite and mod_headers to be enabled.
<IfModule mod_headers.c>
# Serve gzip compressed CSS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
# Serve gzip compressed JS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
# Serve correct content types, and prevent double compression.
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
<FilesMatch "(\.js\.gz|\.css\.gz)$">
# Serve correct encoding type.
Header set Content-Encoding gzip
# Force proxies to cache gzipped & non-gzipped css/js files separately.
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
</IfModule>
# Various header fixes.
<IfModule mod_headers.c>
# Disable content sniffing, since it's an attack vector.
Header always set X-Content-Type-Options nosniff
# Disable Proxy header, since it's an attack vector.
RequestHeader unset Proxy
</IfModule>
-3
View File
@@ -1,3 +0,0 @@
Please read core/INSTALL.txt for detailed installation instructions for your
Drupal web site.
-77
View File
@@ -1,77 +0,0 @@
# This is a dotenv file used by JavaScript tasks.
# Copy this to '.env' to override.
#############################
# General Test Environment #
#############################
# This is the URL that Drupal can be accessed by. You don't need an installed
# site here, just make sure you can at least access the installer screen. If you
# don't already have one running, e.g. Apache, you can use PHP's built-in web
# server by running the following command in your Drupal root folder:
# php -S localhost:8888 .ht.router.php
# DRUPAL_TEST_BASE_URL=http://localhost:8888
DRUPAL_TEST_BASE_URL=
# Tests need to be executed with a user in the same group as the web server
# user.
#DRUPAL_TEST_WEBSERVER_USER=www-data
# By default we use sqlite as database. Use
# mysql://username:password@localhost/databasename#table_prefix for mysql.
DRUPAL_TEST_DB_URL=sqlite://localhost/sites/default/files/db.sqlite
#############
# Webdriver #
#############
# If Chromedriver is running as a service elsewhere, set it here.
# When using DRUPAL_TEST_CHROMEDRIVER_AUTOSTART leave this at the default settings.
DRUPAL_TEST_WEBDRIVER_HOSTNAME=localhost
DRUPAL_TEST_WEBDRIVER_PORT=9515
# If using Selenium, override the path prefix here.
# See http://nightwatchjs.org/gettingstarted#browser-drivers-setup
#DRUPAL_TEST_WEBDRIVER_PATH_PREFIX=/wd/hub
################
# Chromedriver #
################
# Automatically start chromedriver for local development. Set to false when you
# use your own webdriver or chromedriver setup.
# Also set it to false when you use a different browser for testing.
DRUPAL_TEST_CHROMEDRIVER_AUTOSTART=true
# A list of arguments to pass to Chrome, separated by spaces
# e.g. `--disable-gpu --headless --no-sandbox`.
#DRUPAL_TEST_WEBDRIVER_CHROME_ARGS=
##############
# Nightwatch #
##############
# Nightwatch generates output files. Use this to specify the location where these
# files need to be stored. The default location is ignored by git, if you modify
# the location you will probably want to add this location to your .gitignore.
DRUPAL_NIGHTWATCH_OUTPUT=reports/nightwatch
# The path that Nightwatch searches for assumes the same directory structure as
# when you download Drupal core. If you have Drupal installed into a docroot
# folder, you can use the following folder structure to add integration tests
# for your project, outside of tests specifically for custom modules/themes/profiles.
#
# .
# ├── docroot
# │ ├── core
# ├── tests
# │ ├── Nightwatch
# │ │ ├── Tests
# │ │ │ ├── myTest.js
#
# and then set DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY=../
#
#DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY=
# Filter directories to look for tests. This uses minimatch syntax.
# Separate folders with a comma.
DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES=node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest
-8
View File
@@ -1,8 +0,0 @@
assets/vendor/**/*
node_modules/**/*
**/js_test_files/**/*
*.js
!*.es6.js
modules/locale/tests/locale_test.es6.js
!tests/Drupal/Nightwatch/**/*.js
misc/polyfills/object.assign.es6.js
-48
View File
@@ -1,48 +0,0 @@
{
"extends": [
"airbnb",
"plugin:prettier/recommended"
],
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"globals": {
"Drupal": true,
"drupalSettings": true,
"drupalTranslations": true,
"domready": true,
"jQuery": true,
"_": true,
"matchMedia": true,
"Cookies": true,
"Backbone": true,
"Modernizr": true,
"Popper": true,
"Sortable": true,
"CKEDITOR": true
},
"rules": {
"prettier/prettier": "error",
"consistent-return": ["off"],
"no-underscore-dangle": ["off"],
"max-nested-callbacks": ["warn", 3],
"import/no-mutable-exports": ["warn"],
"no-plusplus": ["warn", {
"allowForLoopAfterthoughts": true
}],
"no-param-reassign": ["off"],
"no-prototype-builtins": ["off"],
"valid-jsdoc": ["warn", {
"prefer": {
"returns": "return",
"property": "prop"
},
"requireReturn": false
}],
"no-unused-vars": ["warn"],
"operator-linebreak": ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }]
}
}
-94
View File
@@ -1,94 +0,0 @@
{
"extends": "eslint:recommended",
"root": true,
"env": {
"browser": true
},
"globals": {
"Drupal": true,
"drupalSettings": true,
"drupalTranslations": true,
"domready": true,
"jQuery": true,
"_": true,
"matchMedia": true,
"Backbone": true,
"Modernizr": true,
"CKEDITOR": true
},
"rules": {
"array-bracket-spacing": ["error", "never"],
"block-scoped-var": "error",
"brace-style": ["error", "stroustrup", {"allowSingleLine": true}],
"comma-dangle": ["error", "never"],
"comma-spacing": "error",
"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"curly": ["error", "all"],
"eol-last": "error",
"eqeqeq": ["error", "smart"],
"guard-for-in": "error",
"indent": ["error", 2, {"SwitchCase": 1}],
"key-spacing": ["error", {"beforeColon": false, "afterColon": true}],
"keyword-spacing": ["error", {"before": true, "after": true}],
"linebreak-style": ["error", "unix"],
"lines-around-comment": ["error", {"beforeBlockComment": true, "afterBlockComment": false}],
"new-parens": "error",
"no-array-constructor": "error",
"no-caller": "error",
"no-catch-shadow": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-parens": ["error", "functions"],
"no-implied-eval": "error",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-loop-func": "error",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-native-reassign": "error",
"no-nested-ternary": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-process-exit": "error",
"no-proto": "error",
"no-return-assign": "error",
"no-script-url": "error",
"no-sequences": "error",
"no-shadow-restricted-names": "error",
"no-spaced-func": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-undefined": "error",
"no-unused-expressions": "error",
"no-unused-vars": ["error", {"vars": "all", "args": "none"}],
"no-with": "error",
"object-curly-spacing": ["error", "never"],
"one-var": ["error", "never"],
"quote-props": ["error", "consistent-as-needed"],
"quotes": ["error", "single", "avoid-escape"],
"semi": ["error", "always"],
"semi-spacing": ["error", {"before": false, "after": true}],
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", {"anonymous": "always", "named": "never"}],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
"spaced-comment": ["error", "always"],
"strict": ["error", "function"],
"yoda": ["error", "never"],
"max-nested-callbacks": ["warn", 3],
"valid-jsdoc": ["warn", {
"prefer": {
"returns": "return",
"property": "prop"
},
"requireReturn": false
}]
}
}
-15
View File
@@ -1,15 +0,0 @@
{
"extends": "./.eslintrc.json",
"rules": {
"no-shadow": "off",
"no-new": "off",
"no-continue": "off",
"new-cap": "off",
"max-len": "off",
"default-case": "off",
"prefer-destructuring": "off",
"react/no-this-in-sfc": "off",
"react/destructuring-assignment": "off",
"import/named": "off"
}
}
-21
View File
@@ -1,21 +0,0 @@
# Ignore node_modules folder created when installing core's JavaScript
# dependencies.
node_modules
yarn-error.log
# Ignore overrides of core's phpcs.xml.dist and phpunit.xml.dist.
phpcs.xml
phpunit.xml
# Ignore package-lock.json that is automatically created when adding
# dependencies by users of NPMv5.
package-lock.json
# Ignore test reports
reports
# Ignore local Nightwatch settings
nightwatch.settings.json
# Ignore dotenv
.env
-1
View File
@@ -1 +0,0 @@
modules/locale/tests/locale_test.es6.js
-6
View File
@@ -1,6 +0,0 @@
{
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
-2
View File
@@ -1,2 +0,0 @@
themes/claro/**/*.css
!themes/claro/**/*.pcss.css
-446
View File
@@ -1,446 +0,0 @@
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-no-browser-hacks/lib",
"stylelint-order"
],
"rules": {
"comment-empty-line-before": null,
"function-linear-gradient-no-nonstandard-direction": null,
"function-whitespace-after": null,
"no-descending-specificity": null,
"no-duplicate-selectors": null,
"no-unknown-animations": true,
"media-feature-name-no-unknown": [true, {
"ignoreMediaFeatureNames": [
"prefers-reduced-motion",
"min--moz-device-pixel-ratio"
]
}],
"number-leading-zero": "always",
"order/order": [
"custom-properties",
"dollar-variables",
{
"type": "at-rule",
"hasBlock": false
},
"declarations",
"rules",
{
"type": "at-rule",
"hasBlock": true
}
],
"order/properties-order": [
"position",
"z-index",
"top",
"right",
"bottom",
"left",
"display",
"visibility",
"float",
"clear",
"overflow",
"overflow-x",
"overflow-y",
"-ms-overflow-x",
"-ms-overflow-y",
"-webkit-overflow-scrolling",
"clip",
"zoom",
"flex",
"flex-flow",
"flex-direction",
"flex-wrap",
"flex-basis",
"flex-grow",
"flex-shrink",
"flex-order",
"flex-pack",
"-ms-grid",
"grid",
"grid-area",
"grid-template",
"grid-template-areas",
"-ms-grid-rows",
"grid-template-rows",
"-ms-grid-columns",
"grid-template-columns",
"grid-row",
"-ms-grid-row",
"grid-row-start",
"grid-row-end",
"grid-column",
"-ms-grid-column",
"grid-column-start",
"grid-column-end",
"grid-auto-rows",
"grid-auto-columns",
"grid-auto-flow",
"grid-gap",
"grid-row-gap",
"grid-column-gap",
"-ms-grid-row-align",
"-ms-grid-column-align",
"place-content",
"place-items",
"align-content",
"align-items",
"align-self",
"justify-content",
"justify-items",
"justify-self",
"order",
"-webkit-box-sizing",
"-moz-box-sizing",
"box-sizing",
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left",
"table-layout",
"-webkit-columns",
"-moz-columns",
"columns",
"-webkit-column-span",
"-moz-column-span",
"column-span",
"-webkit-column-width",
"-moz-column-width",
"column-width",
"-webkit-column-count",
"-moz-column-count",
"column-count",
"-webkit-column-fill",
"-moz-column-fill",
"column-fill",
"-webkit-column-gap",
"-moz-column-gap",
"column-gap",
"-webkit-column-rule",
"-moz-column-rule",
"column-rule",
"-webkit-column-rule-width",
"-moz-column-rule-width",
"column-rule-width",
"-webkit-column-rule-style",
"-moz-column-rule-style",
"column-rule-style",
"-webkit-column-rule-color",
"-moz-column-rule-color",
"column-rule-color",
"empty-cells",
"caption-side",
"border-spacing",
"border-collapse",
"$counter-style",
"list-style",
"list-style-position",
"list-style-type",
"list-style-image",
"content",
"quotes",
"counter-reset",
"counter-increment",
"resize",
"cursor",
"-webkit-user-select",
"-moz-user-select",
"-ms-user-select",
"user-select",
"nav-index",
"nav-up",
"nav-right",
"nav-down",
"nav-left",
"-webkit-transition",
"-moz-transition",
"-ms-transition",
"-o-transition",
"transition",
"-webkit-transition-delay",
"-moz-transition-delay",
"-ms-transition-delay",
"-o-transition-delay",
"transition-delay",
"-webkit-transition-timing-function",
"-moz-transition-timing-function",
"-ms-transition-timing-function",
"-o-transition-timing-function",
"transition-timing-function",
"-webkit-transition-duration",
"-moz-transition-duration",
"-ms-transition-duration",
"-o-transition-duration",
"transition-duration",
"-webkit-transition-property",
"-moz-transition-property",
"-ms-transition-property",
"-o-transition-property",
"transition-property",
"-webkit-transform",
"-moz-transform",
"-ms-transform",
"-o-transform",
"transform",
"-webkit-transform-origin",
"-moz-transform-origin",
"-ms-transform-origin",
"-o-transform-origin",
"transform-origin",
"$keyframes",
"-webkit-animation",
"-moz-animation",
"-ms-animation",
"-o-animation",
"animation",
"-webkit-animation-name",
"-moz-animation-name",
"-ms-animation-name",
"-o-animation-name",
"animation-name",
"-webkit-animation-duration",
"-moz-animation-duration",
"-ms-animation-duration",
"-o-animation-duration",
"animation-duration",
"-webkit-animation-play-state",
"-moz-animation-play-state",
"-ms-animation-play-state",
"-o-animation-play-state",
"animation-play-state",
"-webkit-animation-timing-function",
"-moz-animation-timing-function",
"-ms-animation-timing-function",
"-o-animation-timing-function",
"animation-timing-function",
"-webkit-animation-delay",
"-moz-animation-delay",
"-ms-animation-delay",
"-o-animation-delay",
"animation-delay",
"-webkit-animation-iteration-count",
"-moz-animation-iteration-count",
"-ms-animation-iteration-count",
"-o-animation-iteration-count",
"animation-iteration-count",
"-webkit-animation-direction",
"-moz-animation-direction",
"-ms-animation-direction",
"-o-animation-direction",
"animation-direction",
"text-align",
"-webkit-text-align-last",
"-moz-text-align-last",
"-ms-text-align-last",
"text-align-last",
"vertical-align",
"white-space",
"text-decoration",
"text-emphasis",
"text-emphasis-color",
"text-emphasis-style",
"text-emphasis-position",
"text-indent",
"-ms-text-justify",
"text-justify",
"text-transform",
"letter-spacing",
"word-spacing",
"-ms-writing-mode",
"text-outline",
"text-transform",
"text-wrap",
"text-overflow",
"-ms-text-overflow",
"text-overflow-ellipsis",
"text-overflow-mode",
"-ms-word-wrap",
"word-wrap",
"word-break",
"-ms-word-break",
"-moz-tab-size",
"-o-tab-size",
"tab-size",
"-webkit-hyphens",
"-moz-hyphens",
"hyphens",
"pointer-events",
"direction",
"unicode-bidi",
"orphans",
"widows",
"object-fit",
"object-position",
"opacity",
"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity",
"-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha",
"-webkit-filter",
"-ms-filter",
"filter",
"-ms-interpolation-mode",
"color",
"border",
"border-collapse",
"border-width",
"border-style",
"border-color",
"border-top",
"border-top-width",
"border-top-style",
"border-top-color",
"border-right",
"border-right-width",
"border-right-style",
"border-right-color",
"border-bottom",
"border-bottom-width",
"border-bottom-style",
"border-bottom-color",
"border-left",
"border-left-width",
"border-left-style",
"border-left-color",
"-webkit-border-radius",
"-moz-border-radius",
"border-radius",
"-webkit-border-top-left-radius",
"-moz-border-radius-topleft",
"border-top-left-radius",
"-webkit-border-top-right-radius",
"-moz-border-radius-topright",
"border-top-right-radius",
"-webkit-border-bottom-right-radius",
"-moz-border-radius-bottomright",
"border-bottom-right-radius",
"-webkit-border-bottom-left-radius",
"-moz-border-radius-bottomleft",
"border-bottom-left-radius",
"-webkit-border-image",
"-moz-border-image",
"-o-border-image",
"border-image",
"-webkit-border-image-source",
"-moz-border-image-source",
"-o-border-image-source",
"border-image-source",
"-webkit-border-image-slice",
"-moz-border-image-slice",
"-o-border-image-slice",
"border-image-slice",
"-webkit-border-image-width",
"-moz-border-image-width",
"-o-border-image-width",
"border-image-width",
"-webkit-border-image-outset",
"-moz-border-image-outset",
"-o-border-image-outset",
"border-image-outset",
"-webkit-border-image-repeat",
"-moz-border-image-repeat",
"-o-border-image-repeat",
"border-image-repeat",
"outline",
"outline-width",
"outline-style",
"outline-color",
"outline-offset",
"background",
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader",
"background-color",
"background-image",
"background-repeat",
"background-attachment",
"background-position",
"background-position-x",
"-ms-background-position-x",
"background-position-y",
"-ms-background-position-y",
"-webkit-background-clip",
"-moz-background-clip",
"background-clip",
"background-origin",
"-webkit-background-size",
"-moz-background-size",
"-o-background-size",
"background-size",
"box-decoration-break",
"-webkit-box-shadow",
"-moz-box-shadow",
"box-shadow",
"filter:progid:DXImageTransform.Microsoft.gradient",
"-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient",
"text-shadow",
"$font-face",
"font",
"font-family",
"src",
"$font-feature-values",
"$swash",
"$annotation",
"$ornaments",
"$stylistic",
"$styleset",
"$character-variant",
"font-variant-alternates",
"font-size",
"font-weight",
"font-style",
"font-variant",
"font-size-adjust",
"font-stretch",
"font-effect",
"font-emphasize",
"font-emphasize-position",
"font-emphasize-style",
"font-smooth",
"line-height"
],
"plugin/no-browser-hacks": [true, {
"browsers": [
"ie >= 9",
"edge >= 13",
"firefox >= 5",
"opera >= 12",
"safari >= 5",
"chrome >= 56"
]
}],
"property-no-unknown": null,
"rule-empty-line-before": null,
"selector-pseudo-element-colon-notation": null,
"shorthand-property-no-redundant-values": null,
"string-quotes": "double",
"unit-whitelist": ["deg", "em", "ex", "ms", "rem", "%", "s", "px", "vw", "vh"]
},
"ignoreFiles": [
"assets/vendor/**/*.css",
"tests/Drupal/Tests/Core/Asset/css_test_files/**/*.css",
"modules/media/css/plugins/drupalmedia/ckeditor.drupalmedia.css"
]
}
-8
View File
@@ -1,8 +0,0 @@
New minor (feature) releases of Drupal are released every six months and
patch (bugfix) releases are released every month. More information on the
Drupal release cycle: https://www.drupal.org/core/release-cycle-overview
* For a full list of fixes in the latest release, visit:
https://www.drupal.org/latest-release
* API change records for Drupal core:
https://www.drupal.org/list-changes/drupal
-59
View File
@@ -1,59 +0,0 @@
All Drupal code is Copyright 2001 - 2020 by the original authors.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with this program as the file LICENSE.txt; if not, please see
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
Drupal is a registered trademark of Dries Buytaert.
Drupal includes works under other copyright notices and distributed
according to the terms of the GNU General Public License or a compatible
license, including:
Javascript
Farbtastic - Copyright (c) 2010 Matt Farina
HTML5 Shiv - Copyright (c) 2014 Alexander Farkas, Jonathan Neal, Paul Irish,
and John-David Dalton
jQuery - Copyright (c) 2011 John Resig
jQuery Bgiframe - Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net)
jQuery BBQ - Copyright (c) 2010 "Cowboy" Ben Alman
jQuery Cookie - Copyright (c) 2014 Klaus Hartl
jQuery Form - Copyright (c) 2017 Kevin Morris
jQuery Globalize - Copyright (c) 2012 Software Freedom Conservancy, Inc.
jQuery Mousewheel - Copyright OpenJS Foundation and other contributors
(https://openjsf.org/)
jQuery Metadata - Copyright (c) 2006 John Resig, Yehuda Katz, Jörn Zaefferer,
Paul McLanahan
jQuery Once - Copyright (c) 2009 Konstantin Käfer
jQuery UI - Copyright (c) 2015 by the authors and other contributors
(http://jqueryui.com/about)
Sizzle.js - Copyright (c) 2016 JS Foundation and other contributors
(https://js.foundation)
PHP
Drupal depends on numerous PHP Composer packages. All Composer packages
retain the copyright of the authors.
-45
View File
@@ -1,45 +0,0 @@
CREATE THE MySQL DATABASE
--------------------------
This step is only necessary if you don't already have a database set up (e.g.,
by your host). In the following examples, 'username' is an example MySQL user
which has the CREATE and GRANT privileges. Use the appropriate user name for
your system.
First, you must create a new database for your Drupal site (here, 'databasename'
is the name of the new database):
mysqladmin -u username -p create databasename
MySQL will prompt for the 'username' database password and then create the
initial database files. Next you must log in and set the access database rights:
mysql -u username -p
Again, you will be asked for the 'username' database password. At the MySQL
prompt, enter the following command:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER,
CREATE TEMPORARY TABLES ON databasename.*
TO 'username'@'localhost' IDENTIFIED BY 'password';
where:
'databasename' is the name of your database
'username' is the username of your MySQL account
'localhost' is the web server host where Drupal is installed
'password' is the password required for that username
Note: Unless the database user/host combination for your Drupal installation
has all of the privileges listed above (except possibly CREATE TEMPORARY TABLES,
which is currently only used by Drupal core automated tests and some
contributed modules), you will not be able to install or run Drupal.
If successful, MySQL will reply with:
Query OK, 0 rows affected
If the InnoDB storage engine is available, it will be used for all database
tables. InnoDB provides features over MyISAM such as transaction support,
row-level locks, and consistent non-locking reads.
-44
View File
@@ -1,44 +0,0 @@
CREATE THE PostgreSQL DATABASE
------------------------------
Note that the database must be created with UTF-8 (Unicode) encoding.
1. CREATE DATABASE USER
This step is only necessary if you don't already have a user set up (e.g., by
your host), or want to create a new user for use with Drupal only. The
following command creates a new user named 'username' and asks for a password
for that user:
createuser --pwprompt --encrypted --no-createrole --no-createdb username
If there are no errors, then the command was successful.
2. CREATE DRUPAL DATABASE
This step is only necessary if you don't already have a database set up
(e.g., by your host) or want to create a new database for use with Drupal
only. The following command creates a new database named 'databasename',
which is owned by the previously created 'username':
createdb --encoding=UTF8 --owner=username databasename
If there are no errors, then the command was successful.
3. CREATE SCHEMA OR SCHEMAS (Optional advanced step)
Drupal will run across different schemas within your database if you so wish.
By default, Drupal runs inside the 'public' schema but you can use $db_prefix
inside settings.php to define a schema for Drupal to run inside of, or
specify tables that are shared inside of a separate schema. Drupal will not
create schemas for you. In fact, the user that Drupal runs as should not be
allowed to do this. You'll need to execute the SQL below as a superuser,
replace 'username' with the username that Drupal uses to connect to
PostgreSQL, and replace 'schema_name' with a schema name you wish to use,
such as 'shared':
CREATE SCHEMA schema_name AUTHORIZATION username;
Do this for as many schemas as you need. See default.settings.php for
instructions on how to set which tables use which schemas.
-39
View File
@@ -1,39 +0,0 @@
SQLITE REQUIREMENTS
-------------------
PHP's PDO SQLite driver must be enabled. If you do not have pdo_sqlite
available, depending on your system there are different ways to install it.
Windows
-------
Read more about it on http://www.php.net/manual/en/pdo.installation.php
Linux
-----
sudo apt-get install php-sqlite3
SQLITE DATABASE CREATION
------------------------
The Drupal installer will create the SQLite database for you. The only
requirement is that the installer must have write permissions to the directory
where the database file resides. This directory (not just the database file) also
has to remain writable by the web server going forward for SQLite to continue to
be able to operate.
On the "Database configuration" form in the "Database file" field, you must
supply the exact path to where you wish your database file to reside. It is
strongly suggested that you choose a path that is outside of the webroot, yet
ensure that the directory is writable by the web server.
If you must place your database file in your webroot, you could try using the
following in your "Database file" field:
sites/default/files/.ht.sqlite
Note: The .ht in the name will tell Apache to prevent the database from being
downloaded. Please check that the file is, indeed, protected by your webserver.
If not, please consult the documentation of your webserver on how to protect a
file from downloading.
-459
View File
@@ -1,459 +0,0 @@
CONTENTS OF THIS FILE
---------------------
* Quickstart
* Requirements and notes
* Optional server requirements
* Installation
* Reinstall
* Building and customizing your site
* Multisite configuration
* Multilingual configuration
QUICKSTART
----------------------
Prerequisites:
- PHP 7.0.8 (or greater) (https://php.net).
In the instructions below, replace the version x.y.z with the specific version
you wish to download. Example: 8.6.0.zip. You can find the latest stable version
at https://www.drupal.org/project/drupal.
Download and extract the Drupal package:
- curl -sS https://ftp.drupal.org/files/projects/drupal-x.y.z.zip --output drupal-x.y.z.zip
- unzip drupal-x.y.z.zip
- cd /path/to/drupal-x.y.z
- php core/scripts/drupal quick-start
Wait… installation can take a minute or two. A successful installation will
result in opening the new site in your browser.
Run the following command for a list of available options that you may need to
configure quick-start:
- php core/scripts/drupal quick-start --help
Follow the instructions in the REINSTALL section below to start over.
NOTE: This quick start solution uses PHP's built-in web server and is not
intended for production use. Read more about how to run Drupal in a production
environment below.
REQUIREMENTS AND NOTES
----------------------
Drupal requires:
- A web server with PHP support, for example:
- Apache 2.0 (or greater) (http://httpd.apache.org/).
- Nginx 1.1 (or greater) (http://nginx.com/).
- PHP 7.0.8 (or greater) (http://php.net/). For better security support it is
recommended to update to at least 7.2.17.
- One of the following databases:
- MySQL 5.5.3 (or greater) (http://www.mysql.com/).
- MariaDB 5.5.20 (or greater) (https://mariadb.org/). MariaDB is a fully
compatible drop-in replacement for MySQL.
- Percona Server 5.5.8 (or greater) (http://www.percona.com/). Percona
Server is a backwards-compatible replacement for MySQL.
- PostgreSQL 9.1.2 (or greater) (http://www.postgresql.org/).
- SQLite 3.7.11 (or greater) (http://www.sqlite.org/).
For more detailed information about Drupal requirements, including a list of
PHP extensions and configurations that are required, see "System requirements"
(https://www.drupal.org/requirements) in the Drupal.org online documentation.
For detailed information on how to configure a test server environment using a
variety of operating systems and web servers, see "Local server setup"
(https://www.drupal.org/node/157602) in the Drupal.org online documentation.
Note that all directories mentioned in this document are always relative to the
directory of your Drupal installation, and commands are meant to be run from
this directory (except for the initial commands that create that directory).
OPTIONAL SERVER REQUIREMENTS
----------------------------
- If you want to use Drupal's "Clean URLs" feature on an Apache web server, you
will need the mod_rewrite module and the ability to use local .htaccess
files. For Clean URLs support on IIS, see "Clean URLs with IIS"
(https://www.drupal.org/node/3854) in the Drupal.org online documentation.
- If you plan to use XML-based services such as RSS aggregation, you will need
PHP's XML extension. This extension is enabled by default on most PHP
installations.
- To serve gzip compressed CSS and JS files on an Apache web server, you will
need the mod_headers module and the ability to use local .htaccess files.
- Some Drupal functionality (e.g., checking whether Drupal and contributed
modules need updates, RSS aggregation, etc.) require that the web server be
able to go out to the web and download information. If you want to use this
functionality, you need to verify that your hosting provider or server
configuration allows the web server to initiate outbound connections. Most web
hosting setups allow this.
INSTALLATION
------------
1. Download and extract Drupal.
You can obtain the latest Drupal release from https://www.drupal.org -- the
files are available in .tar.gz and .zip formats and can be extracted using
most compression tools.
To download and extract the files, on a typical Unix/Linux command line, use
the following commands (assuming you want version x.y.z of Drupal in .tar.gz
format):
wget https://www.drupal.org/files/projects/drupal-x.y.z.tar.gz
tar -zxvf drupal-x.y.z.tar.gz
This will create a new directory drupal-x.y.z/ containing all Drupal files
and directories. Then, to move the contents of that directory into a
directory within your web server's document root or your public HTML
directory, continue with this command:
mv drupal-x.y.z/* drupal-x.y.z/.htaccess drupal-x.y.z/.csslintrc drupal-x.y.z/.editorconfig drupal-x.y.z/.eslintignore drupal-x.y.z/.eslintrc.json drupal-x.y.z/.gitattributes /path/to/your/installation
You can also download the latest version of Drupal using Git on the command
line and set up a repository by following the instructions at
https://www.drupal.org/project/drupal/git-instructions for "Setting up
repository for the first time".
Once you have downloaded Drupal successfully, you may install Composer
globally using the instructions at
https://getcomposer.org/doc/00-intro.md#globally
With Composer installed, run the following command from the Drupal web root:
composer install
2. Create the Drupal database.
Because Drupal stores all site information in a database, the Drupal
installer will attempt to create this database for you. If you create the
database manually, you must grant Drupal certain database privileges (such as
the ability to create tables). For details, consult INSTALL.mysql.txt,
INSTALL.pgsql.txt, or INSTALL.sqlite.txt. You may also need to consult your
web hosting provider for instructions specific to your web host.
Take note of the username, password, database name, and hostname as you
create the database. You will enter this information during the install.
3. Run the install script.
To run the install script, point your browser to the base URL of your
website (e.g., http://www.example.com).
You will be guided through several screens to set up the database, add the
site maintenance account (the first user, also known as user/1), and provide
basic web site settings.
During installation, several files and directories need to be created, which
the install script will try to do automatically. However, on some hosting
environments, manual steps are required, and the install script will tell
you that it cannot proceed until you fix certain issues. This is normal and
does not indicate a problem with your server.
The most common steps you may need to perform are:
a. Missing files directory.
The install script will attempt to create a public file storage directory
in the default location at sites/default/files (the location of the files
directory may be changed after Drupal is installed).
If auto-creation fails, you can create the directory yourself. (If you are
creating a multisite installation, substitute the correct sites directory
for sites/default; see the Multisite Configuration section of this file,
below.) Sample commands from a Unix/Linux command line:
mkdir sites/default/files
chmod a+w sites/default/files
Alternatively, you can make the install script work by changing
permissions on the sites/default directory. The web server can then
create the files directory within it for you.
For example, on a Unix/Linux command line, you can grant everyone
(including the web server) permission to write to the sites/default
directory with this command:
chmod a+w sites/default
Then re-run install.php (e.g. by clicking "try again" at the bottom of
the Requirements problem page. Once the files directory is created, you
will need to grant everyone (including the web server) permission to
write to it with this command:
chmod a+w sites/default/files
Be sure to set the permissions for the default directory back after the
installation is finished! (Leave the files directory writable.)
Sample command:
chmod go-w sites/default
b. Missing settings file.
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 file with the command:
cp sites/default/default.settings.php sites/default/settings.php
Next, grant write privileges to the file to everyone (including the web
server) with the command:
chmod a+w sites/default/settings.php
Be sure to set the permissions back after the installation is finished!
Sample command:
chmod go-w sites/default/settings.php
c. Write permissions after install.
The install script will attempt to write-protect the settings.php file and
the sites/default directory after saving your configuration. If this
fails, you will be notified, and you can do it manually. Sample commands
from a Unix/Linux command line:
chmod go-w sites/default/settings.php
chmod go-w sites/default
4. Verify that the site is working.
When the install script finishes, you will be logged in with the site
maintenance account on a "Welcome" page. If the default Drupal theme is not
displaying properly and links on the page result in "Page Not Found" errors,
you may be experiencing problems with clean URLs. Visit
https://www.drupal.org/docs/8/clean-urls-in-drupal-8 to troubleshoot.
5. Change file system storage settings (optional).
The files directory created in step 3 is the default file system path used to
store all uploaded files, as well as some temporary files created by
Drupal. After installation, you can modify the file system path to store
uploaded files in a different location.
It is not necessary to modify this path, but you may wish to change it if:
- Your site runs multiple Drupal installations from a single codebase (modify
the file system path of each installation to a different directory so that
uploads do not overlap between installations).
- Your site runs on a number of web servers behind a load balancer or reverse
proxy (modify the file system path on each server to point to a shared file
repository).
- You want to restrict access to uploaded files.
To modify the file system path:
a. Ensure that the new location for the path exists and is writable by the
web server. For example, to create a new directory named uploads and grant
write permissions, use the following commands on a Unix/Linux command
line:
mkdir uploads
chmod a+w uploads
b. Open your settings.php in a plain-text editor, and uncomment (remove the #
at the start of line) this line:
# $settings['file_public_path'] = 'sites/default/files';
Enter the desired path and save the file.
If you want to use private file storage, you need to uncomment (remove
the # at the start of line) the following line in settings.php:
# $settings['file_private_path'] = '';
Enter the path for private files and save the file.
Changing the file system path after files have been uploaded may cause
unexpected problems on an existing site. If you modify the file system path
on an existing site, remember to copy all files from the original location
to the new location.
6. Revoke documentation file permissions (optional).
Some administrators suggest making the documentation files, especially
CHANGELOG.txt, non-readable so that the exact version of Drupal you are
running is slightly more difficult to determine. If you wish to implement
this optional security measure, from a Unix/Linux command line you can use
the following command:
chmod a-r core/CHANGELOG.txt
Note that the example only affects CHANGELOG.txt. To completely hide all
documentation files from public view, repeat this command for each of the
Drupal documentation files in the installation directory, substituting the
name of each file for CHANGELOG.txt in the example.
For more information on setting file permissions, see "Modifying Linux,
Unix, and Mac file permissions" (https://www.drupal.org/node/202483) or
"Modifying Windows file permissions" (https://www.drupal.org/node/202491) in
the Drupal.org online documentation.
7. Set up independent "cron" maintenance jobs.
Many Drupal modules have tasks that must be run periodically, including the
Search module (building and updating the index used for keyword searching),
the Aggregator module (retrieving feeds from other sites), and the System
module (performing routine maintenance and pruning of database tables). These
tasks are known as "cron maintenance tasks", named after the Unix/Linux
"cron" utility.
When you install Drupal, its built-in cron feature is enabled, which
automatically runs the cron tasks periodically, triggered by people visiting
pages of your site. You can configure the built-in cron feature by navigating
to Administration > Configuration > System > Cron.
It is also possible to run the cron tasks independent of site visits; this is
recommended for most sites. To do this, you will need to set up an automated
process to visit the page /cron on your site, which executes the cron
tasks.
The URL of the cron page requires a "cron key" to protect against
unauthorized access. Your site's cron key is automatically generated during
installation and is specific to your site. The full URL of the page, with the
cron key, is available in the "Cron maintenance tasks" section of the Status
report page at Administration > Reports > Status report.
As an example of how to set up this automated process, you can use the
crontab utility on Unix/Linux systems. The following crontab line uses the
wget command to visit the cron page, and runs each hour, on the hour:
0 * * * * wget -O - -q -t 1 http://example.com/cron/YOURKEY
Replace the text "http://example.com/cron/YOURKEY" in the example with the
full URL displayed under "Cron maintenance tasks" on the "Status report"
page.
More information about cron maintenance tasks is available at
https://www.drupal.org/cron, and sample cron shell scripts can be found in
the core/scripts/ directory. (Note that these scripts must be customized like
the above example, to add your site-specific cron key and domain name.)
REINSTALL
------------
Drupal can be reinstalled without downloading and extracting the Drupal release.
1. Drop all the tables in your database.
2. Remove everything in sites/default/files.
3. Remove sites/default/settings.php.
4. Follow the Installation Instructions above starting from Step 3 (Run the
install script).
BUILDING AND CUSTOMIZING YOUR SITE
----------------------------------
A new installation of Drupal defaults to a very basic configuration. To extend
your site, you use "modules" and "themes". A module is a plugin that adds
functionality to Drupal, while a theme changes the look of your site. The core
of Drupal provides several optional modules and themes, and you can download
more at https://www.drupal.org/project/project_module and
https://www.drupal.org/project/project_theme
Do not mix downloaded or custom modules and themes with Drupal's core modules
and themes. Drupal's modules and themes are located in the /core/modules and
/core/themes directories, while the modules and themes you add to Drupal are
normally placed in the /modules and /themes directories. If you run a multisite
installation, you can also place modules and themes in the site-specific
directories -- see the Multisite Configuration section, below.
Never edit Drupal's core modules and themes; instead, use the hooks available in
the Drupal API. To modify the behavior of Drupal, develop a module as described
at https://www.drupal.org/developing/modules. To modify the look of Drupal,
create a subtheme as described at https://www.drupal.org/node/2165673, or a
completely new theme as described at https://www.drupal.org/docs/8/theming
MULTISITE CONFIGURATION
-----------------------
A single Drupal installation can host several Drupal-powered sites, each with
its own individual configuration.
For this to work you need the file sites/sites.php to exist. Make a copy of
the example.sites.php file:
$ cp sites/example.sites.php sites/sites.php
Additional site configurations are created in subdirectories within the 'sites'
directory. Each subdirectory must have a 'settings.php' file, which specifies
the configuration settings. The easiest way to create additional sites is to
copy file 'default.settings.php' from the 'sites/default' directory into the
new site directory with file name 'settings.php' and modify as appropriate.
The new directory name is constructed from the site's URL. The configuration
for www.example.com could be in 'sites/example.com/settings.php' (note that
'www.' should be omitted if users can access your site at http://example.com/).
$ cp sites/default/default.settings.php sites/example.com/settings.php
Sites do not have to have a different domain. You can also use subdomains and
subdirectories for Drupal sites. For example, example.com, sub.example.com, and
sub.example.com/site3 can all be defined as independent Drupal sites. The setup
for a configuration such as this would look like the following:
sites/default/settings.php
sites/example.com/settings.php
sites/sub.example.com/settings.php
sites/sub.example.com.site3/settings.php
When searching for a site configuration (for example www.sub.example.com/site3),
Drupal will search for configuration files in the following order, using the
first configuration it finds:
sites/www.sub.example.com.site3/settings.php
sites/sub.example.com.site3/settings.php
sites/example.com.site3/settings.php
sites/www.sub.example.com/settings.php
sites/sub.example.com/settings.php
sites/example.com/settings.php
sites/default/settings.php
If you are installing on a non-standard port, the port number is treated as the
deepest subdomain. For example: http://www.example.com:8080/ could be loaded
from sites/8080.www.example.com/. The port number will be removed according to
the pattern above if no port-specific configuration is found, just like a real
subdomain.
Each site configuration can have its own site-specific modules and themes in
addition to those installed in the standard 'modules' and 'themes' directories.
To use site-specific modules or themes, simply create a 'modules' or 'themes'
directory within the site configuration directory. For example, if
sub.example.com has a custom theme and a custom module that should not be
accessible to other sites, the setup would look like this:
sites/sub.example.com/
settings.php
themes/custom_theme
modules/custom_module
For more information about multiple virtual hosts or the configuration
settings, consult https://www.drupal.org/docs/8/multisite
For more information on configuring Drupal's file system path in a multisite
configuration, see step 6 above.
MULTILINGUAL CONFIGURATION
--------------------------
By default, Drupal is installed in one language, and further languages may be
installed later.
For detailed instructions, visit
https://www.drupal.org/docs/8/multilingual
-339
View File
@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
-549
View File
@@ -1,549 +0,0 @@
Drupal core is built and maintained by the Drupal project community. Everyone is
encouraged to submit issues and changes (patches) to improve Drupal, and to
contribute in other ways -- see https://www.drupal.org/contribute to find out
how.
This file lists the active maintainers. For a list of past maintainers, see:
https://www.drupal.org/core/maintainers/past
Core committers
---------------
The Drupal Core committers oversee the development of Drupal as a whole. The
core committers for Drupal are (in alphabetical order):
BDFL
- Dries Buytaert 'dries' https://www.drupal.org/u/dries
Product managers
- Dries Buytaert 'dries' https://www.drupal.org/u/dries
- Angela Byron 'webchick' https://www.drupal.org/u/webchick
- Gábor Hojtsy 'Gábor Hojtsy' https://www.drupal.org/u/gábor-hojtsy
- Roy Scholten 'yoroy' https://www.drupal.org/u/yoroy
Framework managers
Backend
- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia
- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch
- Francesco Placella 'plach' https://www.drupal.org/u/plach
- Alex Pott 'alexpott' https://www.drupal.org/u/alexpott
- Lee Rowlands 'larowlan' https://www.drupal.org/u/larowlan
Frontend
- Lauri Eskola 'lauriii' https://www.drupal.org/u/lauriii
Release managers
- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch
- Jess Myrbo 'xjm' https://www.drupal.org/u/xjm
Committer team facilitators
- (provisional) Pamela Barone 'pameeela' https://www.drupal.org/u/pameeela
Subsystem maintainers
---------------------
The Drupal Core subsystem maintainers oversee the development of Drupal
subsystems. See https://www.drupal.org/contribute/core-maintainers for more
information on their responsibilities, and to find out how to become a subsystem
maintainer. Current subsystem maintainers for Drupal 8:
Actions
- ?
Aggregator
- ?
Ajax
- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
Asset Library API
- ?
Authentication and Authorization
- ?
Automated Cron
- ?
Ban
- ?
Bartik
- Emma Maria Karayiannis 'emma.maria' https://www.drupal.org/u/emma.maria
Base system
- ?
Basic Auth
- Juampy Novillo Requena 'juampy' https://www.drupal.org/u/juampy
Batch API
- John Cook 'John Cook' https://www.drupal.org/u/john-cook
BigPipe
- Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers
- Fabian Franz 'Fabianx' https://www.drupal.org/u/fabianx
Block
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
- Ben Dougherty 'benjy' https://www.drupal.org/u/benjy
Block Content
- Lee Rowlands 'larowlan' https://www.drupal.org/u/larowlan
Book
- Peter Wolanin 'pwolanin' https://www.drupal.org/u/pwolanin
Bootstrap
- ?
Breakpoint
- Peter Droogmans 'attiks' https://www.drupal.org/u/attiks
- Marc Drummond 'mdrummond' https://www.drupal.org/u/mdrummond
Cache
- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch
CKEditor
- Henrik Danielsson 'TwoD' https://www.drupal.org/u/TwoD
- Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers
- Marek 'mlewand' Lewandowski https://www.drupal.org/u/mlewand
Classy
- David Hernandez 'davidhernandez' https://www.drupal.org/u/davidhernandez
Color
- ?
Comment
- Lee Rowlands 'larowlan' https://www.drupal.org/u/larowlan
- Andrey Postnikov 'andypost' https://www.drupal.org/u/andypost
Configuration API
- Alex Pott 'alexpott' https://www.drupal.org/u/alexpott
- Matthew Tift 'mtift' https://www.drupal.org/u/mtift
Configuration Entity API
- Alex Pott 'alexpott' https://www.drupal.org/u/alexpott
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
Configuration UI
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
Configuration Translation
- Gábor Hojtsy 'Gábor Hojtsy' https://www.drupal.org/u/gábor-hojtsy
- Tobias Zimmermann 'tstoeckler' https://www.drupal.org/u/tstoeckler
- Vijayachandran Mani 'vijaycs85' https://www.drupal.org/u/vijaycs85
Contact
- Lee Rowlands 'larowlan' https://www.drupal.org/u/larowlan
- Jibran Ijaz 'jibran' https://www.drupal.org/u/jibran
- Andrey Postnikov 'andypost' https://www.drupal.org/u/andypost
Content Moderation
- Sam Becker 'Sam152' https://www.drupal.org/u/sam152
Content Translation
- Francesco Placella 'plach' https://www.drupal.org/u/plach
Contextual
- ?
Cron
- ?
CSS
- John Albin Wilkins 'JohnAlbin' https://www.drupal.org/u/johnalbin
Database API
- ?
MySQL DB driver
- David Strauss 'David Strauss' https://www.drupal.org/u/david-strauss
PostgreSQL DB driver
- ?
Sqlite DB driver
- ?
Database Logging
- Mariano D'Agostino 'dagmar' https://www.drupal.org/u/dagmar
Database Update API
- ?
DateTime
- Jonathan Hedstrom 'jhedstrom' https://www.drupal.org/u/jhedstrom
- Matthew Donadio 'mpdonadio' https://www.drupal.org/u/mpdonadio
DateTime Range
- Jonathan Hedstrom 'jhedstrom' https://www.drupal.org/u/jhedstrom
- Matthew Donadio 'mpdonadio' https://www.drupal.org/u/mpdonadio
Dynamic Page Cache
- Fabian Franz 'Fabianx' https://www.drupal.org/u/fabianx
- Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers
Editor
- Henrik Danielsson 'TwoD' https://www.drupal.org/u/TwoD
- Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers
Entity API
- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch
- Hristo Chonov 'hchonov' https://www.drupal.org/u/hchonov
- Sascha Grossenbacher 'Berdir' https://www.drupal.org/u/berdir
- Francesco Placella 'plach' https://www.drupal.org/u/plach
- Tobias Zimmermann 'tstoeckler' https://www.drupal.org/u/tstoeckler
Extension API
- ?
Field API
- Andrei Mateescu 'amateescu' https://www.drupal.org/u/amateescu
Field UI
- Yves Chedemois 'yched' https://www.drupal.org/u/yched
- Andrei Mateescu 'amateescu' https://www.drupal.org/u/amateescu
File
- Kim Pepper 'kim.pepper' https://www.drupal.org/u/kimpepper
Filter
- ?
Forum
- Lee Rowlands 'larowlan' https://www.drupal.org/u/larowlan
Form API
- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
History
- Andrey Postnikov 'andypost' https://www.drupal.org/u/andypost
Hypertext Application Language (HAL)
- ?
Help
- ?
Help Topics
- Amber Matz 'Amber Himes Matz' https://www.drupal.org/u/amber-himes-matz
- Andrey Postnikov 'andypost' https://www.drupal.org/u/andypost
Image
- Claudiu Cristea 'claudiu.cristea' https://www.drupal.org/u/claudiu.cristea
Inline Form Errors
- Daniël Smidt 'dmsmidt' https://www.drupal.org/u/dmsmidt
Installer
- ?
Interface Translation (locale)
- Gábor Hojtsy 'Gábor Hojtsy' https://www.drupal.org/u/gábor-hojtsy
JavaScript
- Théodore Biadala 'nod_' https://www.drupal.org/u/nod_
- Sally Young 'justafish' https://www.drupal.org/u/justafish
JSON:API
- Gabe Sullice 'gabesullice' https://www.drupal.org/u/gabesullice
- Mateu Aguiló Bosch 'e0ipso' https://www.drupal.org/u/e0ipso
- Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers
Language
- Francesco Placella 'plach' https://www.drupal.org/u/plach
- Daniel F. Kudwien 'sun' https://www.drupal.org/u/sun
Layout Builder
- Ted Bowman 'tedbow' https://www.drupal.org/u/tedbow
- Emilie Nouveau 'DyanneNova' https://www.drupal.org/u/dyannenova
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
Link Field
- Weber Macedo 'Mac_Weber' https://www.drupal.org/u/mac_weber
Lock
- ?
Mail
- ?
Markup
- ?
Media
- Sean Blommaert 'seanB' https://www.drupal.org/u/seanb
- Marcos Cano 'marcoscano' https://www.drupal.org/u/marcoscano
- Christian Fritsch 'chr.fritsch' https://www.drupal.org/u/chr.fritsch
- Adam Globus-Hoenich 'phenaproxima' https://www.drupal.org/u/phenaproxima
Media Library
- Sean Blommaert 'seanB' https://www.drupal.org/u/seanb
- Adam Globus-Hoenich 'phenaproxima' https://www.drupal.org/u/phenaproxima
Menu
- Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner
- Peter Wolanin 'pwolanin' https://www.drupal.org/u/pwolanin
Menu Link Content
- Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner
- Peter Wolanin 'pwolanin' https://www.drupal.org/u/pwolanin
Menu UI
- ?
Migrate
- Benji Fisher 'benjifisher' https://www.drupal.org/u/benjifisher
- Adam Globus-Hoenich 'phenaproxima' https://www.drupal.org/u/phenaproxima
- Lucas Hedding 'heddn' https://www.drupal.org/u/heddn
- Michael Lutz 'mikelutz' https://www.drupal.org/u/mikelutz
- Vicki Spagnolo 'quietone' https://www.drupal.org/u/quietone
Node
- ?
Node Access
- Ken Rickard 'agentrickard' https://www.drupal.org/u/agentrickard
- Moshe Weitzman 'moshe weitzman' https://www.drupal.org/u/moshe-weitzman
- Jess Myrbo 'xjm' https://www.drupal.org/u/xjm
Options
- ?
Page Cache
- Lorenz Schori 'znerol' https://www.drupal.org/u/znerol
- Fabian Franz 'Fabianx' https://www.drupal.org/u/fabianx
Path
- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch
Path Alias
- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch
Plugin
- Kris Vanderwater 'EclipseGc' https://www.drupal.org/u/eclipseGc
- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
Queue
- James Gilliland 'neclimdul' https://www.drupal.org/u/neclimdul
Quick Edit
- Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers
- Théodore Biadala 'nod_' https://www.drupal.org/u/nod_
RDF
- ?
Render API
- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia
- Moshe Weitzman 'moshe weitzman' https://www.drupal.org/u/moshe-weitzman
Request Processing
- ?
REST
- Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers
Responsive Image
- Peter Droogmans 'attiks' https://www.drupal.org/u/attiks
- Marc Drummond 'mdrummond' https://www.drupal.org/u/mdrummond
- Jelle Sebreghts 'Jelle_S' https://www.drupal.org/u/jelle_s
Routing
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
Search
- Peter Wolanin 'pwolanin' https://www.drupal.org/u/pwolanin
Serialization
- Damian Lee 'damiankloip' https://www.drupal.org/u/damiankloip
Settings Tray
- Ted Bowman 'tedbow' https://www.drupal.org/u/tedbow
Seven
- ?
Shortcut
- Tobias Zimmermann 'tstoeckler' https://www.drupal.org/u/tstoeckler
- Jibran Ijaz 'jibran' https://www.drupal.org/u/jibran
Stable
- ?
Stark
- John Albin Wilkins 'JohnAlbin' https://www.drupal.org/u/johnalbin
Statistics
- ?
Syslog
- Mariano D'Agostino 'dagmar' https://www.drupal.org/u/dagmar
System (module)
- ?
Taxonomy
- Jess Myrbo 'xjm' https://www.drupal.org/u/xjm
- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch
Telephone
- ?
Testing framework
- Alex Pott 'alexpott' https://www.drupal.org/u/alexpott
- Sascha Grossenbacher 'Berdir' https://www.drupal.org/u/berdir
- Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner
Text Field
- ?
Theme API
- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia
- Fabian Franz 'Fabianx' https://www.drupal.org/u/fabianx
- Joël Pittet 'joelpittet' https://www.drupal.org/u/joelpittet
- Lauri Eskola 'lauriii' https://www.drupal.org/u/lauriii
Token
- ?
Toolbar
- Théodore Biadala 'nod_' https://www.drupal.org/u/nod_
Tour
- Nick Schuch 'nick_schuch' https://www.drupal.org/u/nick_schuch
Tracker
- ?
Transliteration
- Andrei Mateescu 'amateescu' https://www.drupal.org/u/amateescu
Typed Data
- Wolfgang Ziegler 'fago' https://www.drupal.org/u/fago
Umami demo
- Mark Conroy 'markconroy' https://www.drupal.org/u/markconroy
- Gareth Goodwin 'smaz' https://www.drupal.org/u/smaz
- Keith Jay 'kjay' https://www.drupal.org/u/kjay
- Ofer Shaal 'shaal' https://www.drupal.org/u/shaal
Update UI
- ?
User
- Moshe Weitzman 'moshe weitzman' https://www.drupal.org/u/moshe-weitzman
Views
- Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
- Damian Lee 'damiankloip' https://www.drupal.org/u/damiankloip
- Jess Myrbo 'xjm' https://www.drupal.org/u/xjm
- Len Swaneveld 'Lendude' https://www.drupal.org/u/lendude
Workflows
- Sam Becker 'Sam152' https://www.drupal.org/u/sam152
Topic maintainers
-----------------
Accessibility
- Rain Breaw Michaels 'rainbreaw' https://www.drupal.org/u/rainbreaw
- Mike Gifford 'mgifford' https://www.drupal.org/u/mgifford
- Andrew Macpherson 'andrewmacpherson' https://www.drupal.org/u/andrewmacpherson
Documentation
- ?
Performance
- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch
Testing
- ?
Usability
- Cristina Chumillas 'ckrina' https://www.drupal.org/u/ckrina
- Roy Scholten 'yoroy' https://www.drupal.org/u/yoroy
- Bojhan Somers 'Bojhan' https://www.drupal.org/u/bojhan
Provisional membership: None at this time.
Security team
-------------
To report a security issue, see:
https://www.drupal.org/security-team/report-issue
The Drupal security team provides Security Advisories for vulnerabilities,
assists developers in resolving security issues, and provides security
documentation. See https://www.drupal.org/security-team for more information.
The security team lead is:
- Michael Hess 'mlhess' https://www.drupal.org/u/mlhess
Initiative coordinators
-----------------------
The Drupal Core Initiative coordinators oversee approved projects that
re-architect or otherwise improve large areas of Drupal core. See
https://www.drupal.org/community-initiatives/drupal-core for more information on
their responsibilities. The initiative coordinators for Drupal 8 are:
API-first Initiative
- Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers
- Mateu Aguiló Bosch 'e0ipso' https://www.drupal.org/u/e0ipso
- Gabe Sullice 'gabesullice' https://www.drupal.org/u/gabesullice
Admin UI & JavaScript Modernisation Initiative
- Cristina Chumillas 'ckrina' https://www.drupal.org/u/ckrina
- Sally Young 'justafish' https://www.drupal.org/u/justafish
Layout Initiative
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
- Emilie Nouveau 'DyanneNova' https://www.drupal.org/u/dyannenova
Media Initiative
- Janez Urevc 'slashrsm' https://www.drupal.org/u/slashrsm
PHPUnit Initiative
- Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner
- (provisional) Michiel Nugter 'michielnugter' https://www.drupal.org/u/michielnugter
- (provisional) Len Swaneveld 'Lendude' https://www.drupal.org/u/lendude
Workflow Initiative
- Dick Olsson 'dixon_' https://www.drupal.org/u/dixon_
Provisional membership: None at this time.
Core mentoring coordinators
---------------------------
The Drupal Core mentors inspire, enable, and encourage new core contributors.
See https://www.drupal.org/core-mentoring for more information about mentoring.
Mentoring coordinators recruit and coach other mentors. They work on contributor
tools, documentation, and processes to make it easier for new contributors to
get involved. They organize communications and logistics, and actively
participate in mentoring.
- Mauricio Dinarte 'dinarcon' https://www.drupal.org/u/dinarcon
- Lucas Hedding 'heddn' https://www.drupal.org/u/heddn
- Tara King 'sparklingrobots' https://www.drupal.org/u/sparklingrobots
- Rachel Lawson 'rachel_norfolk' https://www.drupal.org/u/rachel_norfolk
- Valery Lourie 'valthebald' https://www.drupal.org/u/valthebald
- Elli Ludwigson 'ekl1773' https://www.drupal.org/u/ekl1773
- Jess Myrbo 'xjm' https://www.drupal.org/u/xjm
- Matthew Radcliffe 'mradcliffe' https://www.drupal.org/u/mradcliffe
Provisional membership: None at this time.
-77
View File
@@ -1,77 +0,0 @@
CONTENTS OF THIS FILE
---------------------
* Introduction
* Minor and patch version updates
* Is my site using Composer?
* Updating code manually
* Updating code with Composer
* Updating Drupal 8 to Drupal 9
* Updating Drupal 6 or 7 to Drupal 9
INTRODUCTION
------------
This document provides links to resources on how to update or migrate your
Drupal site.
MINOR AND PATCH VERSION UPDATES
-------------------------------
Minor and patch updates are done either manually or with Composer, depending on
how the site was installed. Refer to the sections below on updating with
Composer or updating manually for tarball/zip installations.
Minor and patch versions are updates such as:
* Patch releases (e.g. 9.1.2 to 9.1.3)
* Scheduled minor releases (e.g 9.3.5 to 9.4.0)
* Beta to final releases (e.g. 9.1.0-beta2 to 9.1.0)
IS MY SITE USING COMPOSER?
--------------------------
Before updating, determine if your site is currently managed by Composer.
On a typical Unix/Linux command line, this can be determined by running the
following command (replace /PATH/TO/composer with the appropriate location
for your system):
/PATH/TO/composer info drupal/core
UPDATING CODE WITH COMPOSER
---------------------------
* Refer to 'Update Drupal core via Composer' for details on using Composer:
https://www.drupal.org/docs/8/update/update-drupal-core-via-composer
UPDATING CODE MANUALLY
----------------------
* Refer to 'Updating the Core Software' for details on updating manually:
https://www.drupal.org/docs/8/update/update-core-manually
UPDATING DRUPAL 8 TO DRUPAL 9
-----------------------------
1. Prepare the Drupal 8 site for Drupal 9:
https://www.drupal.org/docs/9/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/upgrading-a-drupal-8-site-to-drupal-9
2. Update the Drupal 8 codebase to Drupal 9:
https://www.drupal.org/docs/8/upgrade/upgrading-between-drupal-8-major-versions-eg-from-drupal-8-to-drupal-9
3. Navigate to /update.php to initiate the update process.
UPDATING DRUPAL 6 OR 7 TO DRUPAL 9
----------------------------------
* Updating from a previous major version, such as Drupal 6 or 7, requires
importing the old site configuration and content into a new Drupal 9 site.
Refer to the 'Migrate Guide' for more details on this process:
https://www.drupal.org/upgrade/migrate
-11
View File
@@ -1,11 +0,0 @@
Drupal Scaffold Files are files that are contained inside drupal/core, but are
installed outside of the core directory (e.g. at the Drupal root).
Scaffold files were added to drupal/core in Drupal 8.8.x. During the Drupal 8
development cycle, the scaffold files are also being maintained in their original
locations. This is done so that Drupal sites based on the template project
drupal-composer/drupal-project may continue to download these files from the same
URLs they have historically been found at.
The scaffold files will be deleted from their original location in Drupal 9.
See https://www.drupal.org/project/drupal/issues/3075954 for follow-on work.
-16
View File
@@ -1,16 +0,0 @@
HOW-TO: Test these Drupal scaffold files
In order to test these scaffold files, you'll need to get the entire Drupal repo and
run the tests there.
You'll find the tests in core/tests/Drupal/Tests/ComposerIntegrationTest.php.
You can get the full Drupal repo here:
https://www.drupal.org/project/drupal/git-instructions
You can find more information about running PHPUnit tests with Drupal here:
https://www.drupal.org/node/2116263
You can run a single phpunit test file like so:
$ ./vendor/bin/phpunit -c core core/tests/Drupal/Tests/ComposerIntegrationTest.php
-40
View File
@@ -1,40 +0,0 @@
--errors=box-model,
display-property-grouping,
duplicate-background-images,
duplicate-properties,
empty-rules,
ids,
import,
important,
known-properties,
outline-none,
overqualified-elements,
qualified-headings,
shorthand,
star-property-hack,
text-indent,
underscore-property-hack,
unique-headings,
unqualified-attributes,
vendor-prefix,
zero-units
--ignore=adjoining-classes,
box-sizing,
bulletproof-font-face,
compatible-vendor-prefixes,
errors,
fallback-colors,
floats,
font-faces,
font-sizes,
gradients,
import-ie-limit,
order-alphabetical,
regex-selectors,
rules-count,
selector-max,
selector-max-approaching,
selector-newline,
universal-selector
--exclude-list=core/assets,
vendor
@@ -1,174 +0,0 @@
parameters:
session.storage.options:
# Default ini options for sessions.
#
# Some distributions of Linux (most notably Debian) ship their PHP
# installations with garbage collection (gc) disabled. Since Drupal depends
# on PHP's garbage collection for clearing sessions, ensure that garbage
# collection occurs by using the most common settings.
# @default 1
gc_probability: 1
# @default 100
gc_divisor: 100
#
# Set session lifetime (in seconds), i.e. the time from the user's last
# visit to the active session may be deleted by the session garbage
# collector. When a session is deleted, authenticated users are logged out,
# and the contents of the user's $_SESSION variable is discarded.
# @default 200000
gc_maxlifetime: 200000
#
# Set session cookie lifetime (in seconds), i.e. the time from the session
# is created to the cookie expires, i.e. when the browser is expected to
# discard the cookie. The value 0 means "until the browser is closed".
# @default 2000000
cookie_lifetime: 2000000
#
# Drupal automatically generates a unique session cookie name based on the
# full domain name used to access the site. This mechanism is sufficient
# for most use-cases, including multi-site deployments. However, if it is
# desired that a session can be reused across different subdomains, the
# cookie domain needs to be set to the shared base domain. Doing so assures
# that users remain logged in as they cross between various subdomains.
# To maximize compatibility and normalize the behavior across user agents,
# the cookie domain should start with a dot.
#
# @default none
# cookie_domain: '.example.com'
#
twig.config:
# 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, '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 auto_reload below).
#
# For more information about debugging Twig templates, see
# https://www.drupal.org/node/1906392.
#
# Not recommended in production environments
# @default false
debug: false
# Twig auto-reload:
#
# Automatically recompile Twig templates whenever the source code changes.
# If you don't provide a value for auto_reload, it will be determined
# based on the value of debug.
#
# Not recommended in production environments
# @default null
auto_reload: null
# Twig cache:
#
# By default, Twig templates will be compiled and stored in the filesystem
# to increase performance. Disabling the Twig cache will recompile the
# templates from source each time they are used. In most cases the
# auto_reload setting above should be enabled rather than disabling the
# Twig cache.
#
# Not recommended in production environments
# @default true
cache: true
renderer.config:
# Renderer required cache contexts:
#
# The Renderer will automatically associate these cache contexts with every
# render array, hence varying every render array by these cache contexts.
#
# @default ['languages:language_interface', 'theme', 'user.permissions']
required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions']
# Renderer automatic placeholdering conditions:
#
# Drupal allows portions of the page to be automatically deferred when
# rendering to improve cache performance. That is especially helpful for
# cache contexts that vary widely, such as the active user. On some sites
# those may be different, however, such as sites with only a handful of
# users. If you know what the high-cardinality cache contexts are for your
# site, specify those here. If you're not sure, the defaults are fairly safe
# in general.
#
# For more information about rendering optimizations see
# https://www.drupal.org/developing/api/8/render/arrays/cacheability#optimizing
auto_placeholder_conditions:
# Max-age at or below which caching is not considered worthwhile.
#
# Disable by setting to -1.
#
# @default 0
max-age: 0
# Cache contexts with a high cardinality.
#
# Disable by setting to [].
#
# @default ['session', 'user']
contexts: ['session', 'user']
# Tags with a high invalidation frequency.
#
# Disable by setting to [].
#
# @default []
tags: []
# Cacheability debugging:
#
# Responses with cacheability metadata (CacheableResponseInterface instances)
# get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers.
#
# For more information about debugging cacheable responses, see
# https://www.drupal.org/developing/api/8/response/cacheable-response-interface
#
# Not recommended in production environments
# @default false
http.response.debug_cacheability_headers: false
factory.keyvalue:
{}
# Default key/value storage service to use.
# @default keyvalue.database
# default: keyvalue.database
# Collection-specific overrides.
# state: keyvalue.database
factory.keyvalue.expirable:
{}
# Default key/value expirable storage service to use.
# @default keyvalue.database.expirable
# default: keyvalue.database.expirable
# Allowed protocols for URL generation.
filter_protocols:
- http
- https
- ftp
- news
- nntp
- tel
- telnet
- mailto
- irc
- ssh
- sftp
- webcal
- rtsp
# Configure Cross-Site HTTP requests (CORS).
# Read https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
# for more information about the topic in general.
# Note: By default the configuration is disabled.
cors.config:
enabled: false
# Specify allowed headers, like 'x-allowed-header'.
allowedHeaders: []
# Specify allowed request methods, specify ['*'] to allow all possible ones.
allowedMethods: []
# Configure requests allowed from specific origins.
allowedOrigins: ['*']
# Sets the Access-Control-Expose-Headers header.
exposedHeaders: false
# Sets the Access-Control-Max-Age header.
maxAge: false
# Sets the Access-Control-Allow-Credentials header.
supportsCredentials: false
@@ -1,797 +0,0 @@
<?php
// @codingStandardsIgnoreFile
/**
* @file
* Drupal site-specific configuration file.
*
* IMPORTANT NOTE:
* This file may have been set to read-only by the Drupal installation program.
* If you make changes to this file, be sure to protect it again after making
* your modifications. Failure to remove write permissions to this file is a
* security risk.
*
* In order to use the selection rules below the multisite aliasing file named
* sites/sites.php must be present. Its optional settings will be loaded, and
* the aliases in the array $sites will override the default directory rules
* below. See sites/example.sites.php for more information about aliases.
*
* The configuration directory will be discovered by stripping the website's
* hostname from left to right and pathname from right to left. The first
* configuration file found will be used and any others will be ignored. If no
* other configuration file is found then the default configuration file at
* 'sites/default' will be used.
*
* For example, for a fictitious site installed at
* https://www.drupal.org:8080/mysite/test/, the 'settings.php' file is searched
* for in the following directories:
*
* - sites/8080.www.drupal.org.mysite.test
* - sites/www.drupal.org.mysite.test
* - sites/drupal.org.mysite.test
* - sites/org.mysite.test
*
* - sites/8080.www.drupal.org.mysite
* - sites/www.drupal.org.mysite
* - sites/drupal.org.mysite
* - sites/org.mysite
*
* - sites/8080.www.drupal.org
* - sites/www.drupal.org
* - sites/drupal.org
* - sites/org
*
* - sites/default
*
* Note that if you are installing on a non-standard port number, prefix the
* hostname with that number. For example,
* https://www.drupal.org:8080/mysite/test/ could be loaded from
* sites/8080.www.drupal.org.mysite.test/.
*
* @see example.sites.php
* @see \Drupal\Core\DrupalKernel::getSitePath()
*
* In addition to customizing application settings through variables in
* settings.php, you can create a services.yml file in the same directory to
* register custom, site-specific service definitions and/or swap out default
* implementations with custom ones.
*/
/**
* Database settings:
*
* The $databases array specifies the database connection or
* connections that Drupal may use. Drupal is able to connect
* to multiple databases, including multiple types of databases,
* during the same request.
*
* One example of the simplest connection array is shown below. To use the
* sample settings, copy and uncomment the code below between the @code and
* @endcode lines and paste it after the $databases declaration. You will need
* to replace the database username and password and possibly the host and port
* with the appropriate credentials for your database system.
*
* The next section describes how to customize the $databases array for more
* specific needs.
*
* @code
* $databases['default']['default'] = [
* 'database' => 'databasename',
* 'username' => 'sqlusername',
* 'password' => 'sqlpassword',
* 'host' => 'localhost',
* 'port' => '3306',
* 'driver' => 'mysql',
* 'prefix' => '',
* 'collation' => 'utf8mb4_general_ci',
* ];
* @endcode
*/
$databases = [];
/**
* Customizing database settings.
*
* Many of the values of the $databases array can be customized for your
* particular database system. Refer to the sample in the section above as a
* starting point.
*
* The "driver" property indicates what Drupal database driver the
* connection should use. This is usually the same as the name of the
* database type, such as mysql or sqlite, but not always. The other
* properties will vary depending on the driver. For SQLite, you must
* specify a database file name in a directory that is writable by the
* webserver. For most other drivers, you must specify a
* username, password, host, and database name.
*
* Drupal core implements drivers for mysql, pgsql, and sqlite. Other drivers
* can be provided by contributed or custom modules. To use a contributed or
* custom driver, the "namespace" property must be set to the namespace of the
* driver. The code in this namespace must be autoloadable prior to connecting
* to the database, and therefore, prior to when module root namespaces are
* added to the autoloader. To add the driver's namespace to the autoloader,
* set the "autoload" property to the PSR-4 base directory of the driver's
* namespace. This is optional for projects managed with Composer if the
* driver's namespace is in Composer's autoloader.
*
* Transaction support is enabled by default for all drivers that support it,
* including MySQL. To explicitly disable it, set the 'transactions' key to
* FALSE.
* Note that some configurations of MySQL, such as the MyISAM engine, don't
* support it and will proceed silently even if enabled. If you experience
* transaction related crashes with such configuration, set the 'transactions'
* key to FALSE.
*
* For each database, you may optionally specify multiple "target" databases.
* A target database allows Drupal to try to send certain queries to a
* different database if it can but fall back to the default connection if not.
* That is useful for primary/replica replication, as Drupal may try to connect
* to a replica server when appropriate and if one is not available will simply
* fall back to the single primary server (The terms primary/replica are
* traditionally referred to as master/slave in database server documentation).
*
* The general format for the $databases array is as follows:
* @code
* $databases['default']['default'] = $info_array;
* $databases['default']['replica'][] = $info_array;
* $databases['default']['replica'][] = $info_array;
* $databases['extra']['default'] = $info_array;
* @endcode
*
* In the above example, $info_array is an array of settings described above.
* The first line sets a "default" database that has one primary database
* (the second level default). The second and third lines create an array
* of potential replica databases. Drupal will select one at random for a given
* request as needed. The fourth line creates a new database with a name of
* "extra".
*
* You can optionally set prefixes for some or all database table names
* by using the 'prefix' setting. If a prefix is specified, the table
* name will be prepended with its value. Be sure to use valid database
* characters only, usually alphanumeric and underscore. If no prefixes
* are desired, leave it as an empty string ''.
*
* To have all database names prefixed, set 'prefix' as a string:
* @code
* 'prefix' => 'main_',
* @endcode
*
* Per-table prefixes are deprecated as of Drupal 8.2, and will be removed in
* Drupal 9.0. After that, only a single prefix for all tables will be
* supported.
*
* To provide prefixes for specific tables, set 'prefix' as an array.
* The array's keys are the table names and the values are the prefixes.
* The 'default' element is mandatory and holds the prefix for any tables
* not specified elsewhere in the array. Example:
* @code
* 'prefix' => [
* 'default' => 'main_',
* 'users' => 'shared_',
* 'sessions' => 'shared_',
* 'role' => 'shared_',
* 'authmap' => 'shared_',
* ],
* @endcode
* You can also use a reference to a schema/database as a prefix. This may be
* useful if your Drupal installation exists in a schema that is not the default
* or you want to access several databases from the same code base at the same
* time.
* Example:
* @code
* 'prefix' => [
* 'default' => 'main.',
* 'users' => 'shared.',
* 'sessions' => 'shared.',
* 'role' => 'shared.',
* 'authmap' => 'shared.',
* ];
* @endcode
* NOTE: MySQL and SQLite's definition of a schema is a database.
*
* Advanced users can add or override initial commands to execute when
* connecting to the database server, as well as PDO connection settings. For
* example, to enable MySQL SELECT queries to exceed the max_join_size system
* variable, and to reduce the database connection timeout to 5 seconds:
* @code
* $databases['default']['default'] = [
* 'init_commands' => [
* 'big_selects' => 'SET SQL_BIG_SELECTS=1',
* ],
* 'pdo' => [
* PDO::ATTR_TIMEOUT => 5,
* ],
* ];
* @endcode
*
* WARNING: The above defaults are designed for database portability. Changing
* them may cause unexpected behavior, including potential data loss. See
* https://www.drupal.org/developing/api/database/configuration for more
* information on these defaults and the potential issues.
*
* More details can be found in the constructor methods for each driver:
* - \Drupal\Core\Database\Driver\mysql\Connection::__construct()
* - \Drupal\Core\Database\Driver\pgsql\Connection::__construct()
* - \Drupal\Core\Database\Driver\sqlite\Connection::__construct()
*
* Sample Database configuration format for PostgreSQL (pgsql):
* @code
* $databases['default']['default'] = [
* 'driver' => 'pgsql',
* 'database' => 'databasename',
* 'username' => 'sqlusername',
* 'password' => 'sqlpassword',
* 'host' => 'localhost',
* 'prefix' => '',
* ];
* @endcode
*
* Sample Database configuration format for SQLite (sqlite):
* @code
* $databases['default']['default'] = [
* 'driver' => 'sqlite',
* 'database' => '/path/to/databasefilename',
* ];
* @endcode
*
* Sample Database configuration format for a driver in a contributed module:
* @code
* $databases['default']['default'] = [
* 'driver' => 'mydriver',
* 'namespace' => 'Drupal\mymodule\Driver\Database\mydriver',
* 'autoload' => 'modules/mymodule/src/Driver/Database/mydriver/',
* 'database' => 'databasename',
* 'username' => 'sqlusername',
* 'password' => 'sqlpassword',
* 'host' => 'localhost',
* 'prefix' => '',
* ];
* @endcode
*/
/**
* Location of the site configuration files.
*
* The $settings['config_sync_directory'] specifies the location of file system
* directory used for syncing configuration data. On install, the directory is
* created. This is used for configuration imports.
*
* The default location for this directory is inside a randomly-named
* directory in the public files path. The setting below allows you to set
* its location.
*/
# $settings['config_sync_directory'] = '/directory/outside/webroot';
/**
* Settings:
*
* $settings contains environment-specific configuration, such as the files
* directory and reverse proxy address, and temporary configuration, such as
* security overrides.
*
* @see \Drupal\Core\Site\Settings::get()
*/
/**
* Salt for one-time login links, cancel links, form tokens, etc.
*
* This variable will be set to a random value by the installer. All one-time
* login links will be invalidated if the value is changed. Note that if your
* site is deployed on a cluster of web servers, you must ensure that this
* variable has the same value on each server.
*
* For enhanced security, you may set this variable to the contents of a file
* outside your document root; you should also ensure that this file is not
* stored with backups of your database.
*
* Example:
* @code
* $settings['hash_salt'] = file_get_contents('/home/example/salt.txt');
* @endcode
*/
$settings['hash_salt'] = '';
/**
* Deployment identifier.
*
* Drupal's dependency injection container will be automatically invalidated and
* rebuilt when the Drupal core version changes. When updating contributed or
* custom code that changes the container, changing this identifier will also
* allow the container to be invalidated as soon as code is deployed.
*/
# $settings['deployment_identifier'] = \Drupal::VERSION;
/**
* Access control for update.php script.
*
* If you are updating your Drupal installation using the update.php script but
* are not logged in using either an account with the "Administer software
* updates" permission or the site maintenance account (the account that was
* created during installation), you will need to modify the access check
* statement below. Change the FALSE to a TRUE to disable the access check.
* After finishing the upgrade, be sure to open this file again and change the
* TRUE back to a FALSE!
*/
$settings['update_free_access'] = FALSE;
/**
* External access proxy settings:
*
* If your site must access the Internet via a web proxy then you can enter the
* proxy settings here. Set the full URL of the proxy, including the port, in
* variables:
* - $settings['http_client_config']['proxy']['http']: The proxy URL for HTTP
* requests.
* - $settings['http_client_config']['proxy']['https']: The proxy URL for HTTPS
* requests.
* You can pass in the user name and password for basic authentication in the
* URLs in these settings.
*
* You can also define an array of host names that can be accessed directly,
* bypassing the proxy, in $settings['http_client_config']['proxy']['no'].
*/
# $settings['http_client_config']['proxy']['http'] = 'http://proxy_user:proxy_pass@example.com:8080';
# $settings['http_client_config']['proxy']['https'] = 'http://proxy_user:proxy_pass@example.com:8080';
# $settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost'];
/**
* Reverse Proxy Configuration:
*
* Reverse proxy servers are often used to enhance the performance
* of heavily visited sites and may also provide other site caching,
* security, or encryption benefits. In an environment where Drupal
* is behind a reverse proxy, the real IP address of the client should
* be determined such that the correct client IP address is available
* to Drupal's logging, statistics, and access management systems. In
* the most simple scenario, the proxy server will add an
* X-Forwarded-For header to the request that contains the client IP
* address. However, HTTP headers are vulnerable to spoofing, where a
* malicious client could bypass restrictions by setting the
* X-Forwarded-For header directly. Therefore, Drupal's proxy
* configuration requires the IP addresses of all remote proxies to be
* specified in $settings['reverse_proxy_addresses'] to work correctly.
*
* Enable this setting to get Drupal to determine the client IP from the
* X-Forwarded-For header. If you are unsure about this setting, do not have a
* reverse proxy, or Drupal operates in a shared hosting environment, this
* setting should remain commented out.
*
* In order for this setting to be used you must specify every possible
* reverse proxy IP address in $settings['reverse_proxy_addresses'].
* If a complete list of reverse proxies is not available in your
* environment (for example, if you use a CDN) you may set the
* $_SERVER['REMOTE_ADDR'] variable directly in settings.php.
* Be aware, however, that it is likely that this would allow IP
* address spoofing unless more advanced precautions are taken.
*/
# $settings['reverse_proxy'] = TRUE;
/**
* Specify every reverse proxy IP address in your environment.
* This setting is required if $settings['reverse_proxy'] is TRUE.
*/
# $settings['reverse_proxy_addresses'] = ['a.b.c.d', ...];
/**
* Reverse proxy trusted headers.
*
* Sets which headers to trust from your reverse proxy.
*
* Common values are:
* - \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL
* - \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED
*
* Note the default value of
* @code
* \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL | \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED
* @endcode
* is not secure by default. The value should be set to only the specific
* headers the reverse proxy uses. For example:
* @code
* \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL
* @endcode
* This would trust the following headers:
* - X_FORWARDED_FOR
* - X_FORWARDED_HOST
* - X_FORWARDED_PROTO
* - X_FORWARDED_PORT
*
* @see \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL
* @see \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED
* @see \Symfony\Component\HttpFoundation\Request::setTrustedProxies
*/
# $settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL | \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED;
/**
* Page caching:
*
* By default, Drupal sends a "Vary: Cookie" HTTP header for anonymous page
* views. This tells a HTTP proxy that it may return a page from its local
* cache without contacting the web server, if the user sends the same Cookie
* header as the user who originally requested the cached page. Without "Vary:
* Cookie", authenticated users would also be served the anonymous page from
* the cache. If the site has mostly anonymous users except a few known
* editors/administrators, the Vary header can be omitted. This allows for
* better caching in HTTP proxies (including reverse proxies), i.e. even if
* clients send different cookies, they still get content served from the cache.
* However, authenticated users should access the site directly (i.e. not use an
* HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid
* getting cached pages from the proxy.
*/
# $settings['omit_vary_cookie'] = TRUE;
/**
* Cache TTL for client error (4xx) responses.
*
* Items cached per-URL tend to result in a large number of cache items, and
* this can be problematic on 404 pages which by their nature are unbounded. A
* fixed TTL can be set for these items, defaulting to one hour, so that cache
* backends which do not support LRU can purge older entries. To disable caching
* of client error responses set the value to 0. Currently applies only to
* page_cache module.
*/
# $settings['cache_ttl_4xx'] = 3600;
/**
* Expiration of cached forms.
*
* Drupal's Form API stores details of forms in a cache and these entries are
* kept for at least 6 hours by default. Expired entries are cleared by cron.
*
* @see \Drupal\Core\Form\FormCache::setCache()
*/
# $settings['form_cache_expiration'] = 21600;
/**
* Class Loader.
*
* If the APC extension is detected, the Symfony APC class loader is used for
* performance reasons. Detection can be prevented by setting
* class_loader_auto_detect to false, as in the example below.
*/
# $settings['class_loader_auto_detect'] = FALSE;
/*
* If the APC extension is not detected, either because APC is missing or
* because auto-detection has been disabled, auto-loading falls back to
* Composer's ClassLoader, which is good for development as it does not break
* when code is moved in the file system. You can also decorate the base class
* loader with another cached solution than the Symfony APC class loader, as
* all production sites should have a cached class loader of some sort enabled.
*
* To do so, you may decorate and replace the local $class_loader variable. For
* example, to use Symfony's APC class loader without automatic detection,
* uncomment the code below.
*/
/*
if ($settings['hash_salt']) {
$prefix = 'drupal.' . hash('sha256', 'drupal.' . $settings['hash_salt']);
$apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $class_loader);
unset($prefix);
$class_loader->unregister();
$apc_loader->register();
$class_loader = $apc_loader;
}
*/
/**
* Authorized file system operations:
*
* The Update Manager module included with Drupal provides a mechanism for
* site administrators to securely install missing updates for the site
* directly through the web user interface. On securely-configured servers,
* the Update manager will require the administrator to provide SSH or FTP
* credentials before allowing the installation to proceed; this allows the
* site to update the new files as the user who owns all the Drupal files,
* instead of as the user the webserver is running as. On servers where the
* webserver user is itself the owner of the Drupal files, the administrator
* will not be prompted for SSH or FTP credentials (note that these server
* setups are common on shared hosting, but are inherently insecure).
*
* Some sites might wish to disable the above functionality, and only update
* the code directly via SSH or FTP themselves. This setting completely
* disables all functionality related to these authorized file operations.
*
* @see https://www.drupal.org/node/244924
*
* Remove the leading hash signs to disable.
*/
# $settings['allow_authorize_operations'] = FALSE;
/**
* Default mode for directories and files written by Drupal.
*
* Value should be in PHP Octal Notation, with leading zero.
*/
# $settings['file_chmod_directory'] = 0775;
# $settings['file_chmod_file'] = 0664;
/**
* Public file base URL:
*
* An alternative base URL to be used for serving public files. This must
* include any leading directory path.
*
* A different value from the domain used by Drupal to be used for accessing
* public files. This can be used for a simple CDN integration, or to improve
* security by serving user-uploaded files from a different domain or subdomain
* pointing to the same server. Do not include a trailing slash.
*/
# $settings['file_public_base_url'] = 'http://downloads.example.com/files';
/**
* Public file path:
*
* A local file system path where public files will be stored. This directory
* must exist and be writable by Drupal. This directory must be relative to
* the Drupal installation directory and be accessible over the web.
*/
# $settings['file_public_path'] = 'sites/default/files';
/**
* Private file path:
*
* A local file system path where private files will be stored. This directory
* must be absolute, outside of the Drupal installation directory and not
* accessible over the web.
*
* Note: Caches need to be cleared when this value is changed to make the
* private:// stream wrapper available to the system.
*
* See https://www.drupal.org/documentation/modules/file for more information
* about securing private files.
*/
# $settings['file_private_path'] = '';
/**
* Temporary file path:
*
* A local file system path where temporary files will be stored. This directory
* must be absolute, outside of the Drupal installation directory and not
* accessible over the web.
*
* If this is not set, the default for the operating system will be used.
*
* @see \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory()
*/
# $settings['file_temp_path'] = '/tmp';
/**
* Session write interval:
*
* Set the minimum interval between each session write to database.
* For performance reasons it defaults to 180.
*/
# $settings['session_write_interval'] = 180;
/**
* String overrides:
*
* To override specific strings on your site with or without enabling the Locale
* module, add an entry to this list. This functionality allows you to change
* a small number of your site's default English language interface strings.
*
* Remove the leading hash signs to enable.
*
* The "en" part of the variable name, is dynamic and can be any langcode of
* any added language. (eg locale_custom_strings_de for german).
*/
# $settings['locale_custom_strings_en'][''] = [
# 'forum' => 'Discussion board',
# '@count min' => '@count minutes',
# ];
/**
* A custom theme for the offline page:
*
* This applies when the site is explicitly set to maintenance mode through the
* administration page or when the database is inactive due to an error.
* The template file should also be copied into the theme. It is located inside
* 'core/modules/system/templates/maintenance-page.html.twig'.
*
* Note: This setting does not apply to installation and update pages.
*/
# $settings['maintenance_theme'] = 'bartik';
/**
* PHP settings:
*
* To see what PHP settings are possible, including whether they can be set at
* runtime (by using ini_set()), read the PHP documentation:
* http://php.net/manual/ini.list.php
* See \Drupal\Core\DrupalKernel::bootEnvironment() for required runtime
* settings and the .htaccess file for non-runtime settings.
* Settings defined there should not be duplicated here so as to avoid conflict
* issues.
*/
/**
* If you encounter a situation where users post a large amount of text, and
* the result is stripped out upon viewing but can still be edited, Drupal's
* output filter may not have sufficient memory to process it. If you
* experience this issue, you may wish to uncomment the following two lines
* and increase the limits of these variables. For more information, see
* http://php.net/manual/pcre.configuration.php.
*/
# ini_set('pcre.backtrack_limit', 200000);
# ini_set('pcre.recursion_limit', 200000);
/**
* Configuration overrides.
*
* To globally override specific configuration values for this site,
* set them here. You usually don't need to use this feature. This is
* useful in a configuration file for a vhost or directory, rather than
* the default settings.php.
*
* Note that any values you provide in these variable overrides will not be
* viewable from the Drupal administration interface. The administration
* interface displays the values stored in configuration so that you can stage
* changes to other environments that don't have the overrides.
*
* There are particular configuration values that are risky to override. For
* example, overriding the list of installed modules in 'core.extension' is not
* supported as module install or uninstall has not occurred. Other examples
* include field storage configuration, because it has effects on database
* structure, and 'core.menu.static_menu_link_overrides' since this is cached in
* a way that is not config override aware. Also, note that changing
* configuration values in settings.php will not fire any of the configuration
* change events.
*/
# $config['system.site']['name'] = 'My Drupal site';
# $config['user.settings']['anonymous'] = 'Visitor';
/**
* Fast 404 pages:
*
* Drupal can generate fully themed 404 pages. However, some of these responses
* are for images or other resource files that are not displayed to the user.
* This can waste bandwidth, and also generate server load.
*
* The options below return a simple, fast 404 page for URLs matching a
* specific pattern:
* - $config['system.performance']['fast_404']['exclude_paths']: A regular
* expression to match paths to exclude, such as images generated by image
* styles, or dynamically-resized images. The default pattern provided below
* also excludes the private file system. If you need to add more paths, you
* can add '|path' to the expression.
* - $config['system.performance']['fast_404']['paths']: A regular expression to
* match paths that should return a simple 404 page, rather than the fully
* themed 404 page. If you don't have any aliases ending in htm or html you
* can add '|s?html?' to the expression.
* - $config['system.performance']['fast_404']['html']: The html to return for
* simple 404 pages.
*
* Remove the leading hash signs if you would like to alter this functionality.
*/
# $config['system.performance']['fast_404']['exclude_paths'] = '/\/(?:styles)|(?:system\/files)\//';
# $config['system.performance']['fast_404']['paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
# $config['system.performance']['fast_404']['html'] = '<!DOCTYPE html><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>';
/**
* Load services definition file.
*/
$settings['container_yamls'][] = $app_root . '/' . $site_path . '/services.yml';
/**
* Override the default service container class.
*
* This is useful for example to trace the service container for performance
* tracking purposes, for testing a service container with an error condition or
* to test a service container that throws an exception.
*/
# $settings['container_base_class'] = '\Drupal\Core\DependencyInjection\Container';
/**
* Override the default yaml parser class.
*
* Provide a fully qualified class name here if you would like to provide an
* alternate implementation YAML parser. The class must implement the
* \Drupal\Component\Serialization\SerializationInterface interface.
*/
# $settings['yaml_parser_class'] = NULL;
/**
* Trusted host configuration.
*
* Drupal core can use the Symfony trusted host mechanism to prevent HTTP Host
* header spoofing.
*
* To enable the trusted host mechanism, you enable your allowable hosts
* in $settings['trusted_host_patterns']. This should be an array of regular
* expression patterns, without delimiters, representing the hosts you would
* like to allow.
*
* For example:
* @code
* $settings['trusted_host_patterns'] = [
* '^www\.example\.com$',
* ];
* @endcode
* will allow the site to only run from www.example.com.
*
* If you are running multisite, or if you are running your site from
* different domain names (eg, you don't redirect http://www.example.com to
* http://example.com), you should specify all of the host patterns that are
* allowed by your site.
*
* For example:
* @code
* $settings['trusted_host_patterns'] = [
* '^example\.com$',
* '^.+\.example\.com$',
* '^example\.org$',
* '^.+\.example\.org$',
* ];
* @endcode
* will allow the site to run off of all variants of example.com and
* example.org, with all subdomains included.
*/
/**
* The default list of directories that will be ignored by Drupal's file API.
*
* By default ignore node_modules and bower_components folders to avoid issues
* with common frontend tools and recursive scanning of directories looking for
* extensions.
*
* @see \Drupal\Core\File\FileSystemInterface::scanDirectory()
* @see \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory()
*/
$settings['file_scan_ignore_directories'] = [
'node_modules',
'bower_components',
];
/**
* The default number of entities to update in a batch process.
*
* This is used by update and post-update functions that need to go through and
* change all the entities on a site, so it is useful to increase this number
* if your hosting configuration (i.e. RAM allocation, CPU speed) allows for a
* larger number of entities to be processed in a single batch run.
*/
$settings['entity_update_batch_size'] = 50;
/**
* Entity update backup.
*
* This is used to inform the entity storage handler that the backup tables as
* well as the original entity type and field storage definitions should be
* retained after a successful entity update process.
*/
$settings['entity_update_backup'] = TRUE;
/**
* Node migration type.
*
* This is used to force the migration system to use the classic node migrations
* instead of the default complete node migrations. The migration system will
* use the classic node migration only if there are existing migrate_map tables
* for the classic node migrations and they contain data. These tables may not
* exist if you are developing custom migrations and do not want to use the
* complete node migrations. Set this to TRUE to force the use of the classic
* node migrations.
*/
$settings['migrate_node_migrate_type_classic'] = FALSE;
/**
* Load local development override configuration, if available.
*
* Create a settings.local.php file to override variables on secondary (staging,
* development, etc.) installations of this site.
*
* Typical uses of settings.local.php include:
* - Disabling caching.
* - Disabling JavaScript/CSS compression.
* - Rerouting outgoing emails.
*
* Keep this code block at the end of this file to take full effect.
*/
#
# if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
# include $app_root . '/' . $site_path . '/settings.local.php';
# }
@@ -1,9 +0,0 @@
# Local development services.
#
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
parameters:
http.response.debug_cacheability_headers: true
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory
@@ -1,3 +0,0 @@
Please read core/INSTALL.txt for detailed installation instructions for your
Drupal web site.
@@ -1,143 +0,0 @@
CONTENTS OF THIS FILE
---------------------
* About Drupal
* Configuration and features
* Installation profiles
* Appearance
* Developing for Drupal
* More information
ABOUT DRUPAL
------------
Drupal is an open source content management platform supporting a variety of
websites ranging from personal weblogs to large community-driven websites. For
more information, see the Drupal website at https://www.drupal.org, and join
the Drupal community at https://www.drupal.org/community.
Legal information about Drupal:
* Know your rights when using Drupal:
See LICENSE.txt in the "core" directory.
* Learn about the Drupal trademark and logo policy:
https://www.drupal.com/trademark
CONFIGURATION AND FEATURES
--------------------------
Drupal core (what you get when you download and extract a drupal-x.y.tar.gz or
drupal-x.y.zip file from https://www.drupal.org/project/drupal) has what you
need to get started with your website. It includes several modules (extensions
that add functionality) for common website features, such as managing content,
user accounts, image uploading, and search. Core comes with many options that
allow site-specific configuration. In addition to the core modules, there are
thousands of contributed modules (for functionality not included with Drupal
core) available for download.
More about configuration:
* Install, update, and maintain Drupal:
See INSTALL.txt and UPDATE.txt in the "core" directory.
* Learn about how to use Drupal to create your site:
https://www.drupal.org/documentation
* Follow best practices:
https://www.drupal.org/best-practices
* Download contributed modules to /modules to extend Drupal's functionality:
https://www.drupal.org/project/modules
* See also: "Developing for Drupal" for writing your own modules, below.
INSTALLATION PROFILES
---------------------
Installation profiles define additional steps (such as enabling modules,
defining content types, etc.) that run after the base installation provided
by core when Drupal is first installed. There are two basic installation
profiles provided with Drupal core.
Installation profiles from the Drupal community modify the installation process
to provide a website for a specific use case, such as a CMS for media
publishers, a web-based project tracking tool, or a full-fledged CRM for
non-profit organizations raising money and accepting donations. They can be
distributed as bare installation profiles or as "distributions". Distributions
include Drupal core, the installation profile, and all other required
extensions, such as contributed and custom modules, themes, and third-party
libraries. Bare installation profiles require you to download Drupal Core and
the required extensions separately; place the downloaded profile in the
/profiles directory before you start the installation process.
More about installation profiles and distributions:
* Read about the difference between installation profiles and distributions:
https://www.drupal.org/docs/8/distributions/creating-distributions
* Download contributed installation profiles and distributions:
https://www.drupal.org/project/distributions
* Develop your own installation profile or distribution:
https://www.drupal.org/docs/8/creating-distributions
APPEARANCE
----------
In Drupal, the appearance of your site is set by the theme (themes are
extensions that set fonts, colors, and layout). Drupal core comes with several
themes. More themes are available for download, and you can also create your own
custom theme.
More about themes:
* Download contributed themes to /themes to modify Drupal's appearance:
https://www.drupal.org/project/themes
* Develop your own theme:
https://www.drupal.org/docs/8/theming
DEVELOPING FOR DRUPAL
---------------------
Drupal contains an extensive API that allows you to add to and modify the
functionality of your site. The API consists of "hooks", which allow modules to
react to system events and customize Drupal's behavior, and functions that
standardize common operations such as database queries and form generation. The
flexible hook architecture means that you should never need to directly modify
the files that come with Drupal core to achieve the functionality you want;
instead, functionality modifications take the form of modules.
When you need new functionality for your Drupal site, search for existing
contributed modules. If you find a module that matches except for a bug or an
additional needed feature, change the module and contribute your improvements
back to the project in the form of a "patch". Create new custom modules only
when nothing existing comes close to what you need.
More about developing:
* Search for existing contributed modules:
https://www.drupal.org/project/modules
* Contribute a patch:
https://www.drupal.org/patch/submit
* Develop your own module:
https://www.drupal.org/developing/modules
* Follow programming best practices:
https://www.drupal.org/developing/best-practices
* Refer to the API documentation:
https://api.drupal.org/api/drupal/8
* Learn from documented Drupal API examples:
https://www.drupal.org/project/examples
MORE INFORMATION
----------------
* See the Drupal.org online documentation:
https://www.drupal.org/documentation
* For a list of security announcements, see the "Security advisories" page at
https://www.drupal.org/security (available as an RSS feed). This page also
describes how to subscribe to these announcements via email.
* For information about the Drupal security process, or to find out how to
report a potential security issue to the Drupal security team, see the
"Security team" page at https://www.drupal.org/security-team
* For information about the wide range of available support options, visit
https://www.drupal.org and click on Community and Support in the top or
bottom navigation.
@@ -1,17 +0,0 @@
# Drupal editor configuration normalization
# @see http://editorconfig.org/
# This is the top-most .editorconfig file; do not search in parent directories.
root = true
# All files.
[*]
end_of_line = LF
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[composer.{json,lock}]
indent_size = 4
@@ -1,8 +0,0 @@
core/**/*
vendor/**/*
sites/**/files/**/*
libraries/**/*
sites/**/libraries/**/*
profiles/**/libraries/**/*
**/js_test_files/**/*
**/node_modules/**/*
@@ -1,3 +0,0 @@
{
"extends": "./core/.eslintrc.json"
}
@@ -1,42 +0,0 @@
# This file contains default .gitignore rules. To use it, copy it to .gitignore,
# and it will cause files like your settings.php and user-uploaded files to be
# excluded from Git version control. This is a common strategy to avoid
# accidentally including private information in public repositories and patch
# files.
#
# Because .gitignore can be specific to your site, this file has a different
# name; updating Drupal core will not override your custom .gitignore file.
# Ignore core when managing all of a project's dependencies with Composer
# including Drupal core.
# core
# Ignore dependencies that are managed with Composer.
# Generally you should only ignore the root vendor directory. It's important
# that core/assets/vendor and any other vendor directories within contrib or
# custom module, theme, etc., are not ignored unless you purposely do so.
/vendor/
# Ignore configuration files that may contain sensitive information.
sites/*/settings*.php
sites/*/services*.yml
# Ignore paths that contain user-generated content.
sites/*/files
sites/*/private
# Ignore SimpleTest multi-site environment.
sites/simpletest
# If you prefer to store your .gitignore file in the sites/ folder, comment
# or delete the previous settings and uncomment the following ones, instead.
# Ignore configuration files that may contain sensitive information.
# */settings*.php
# Ignore paths that contain user-generated content.
# */files
# */private
# Ignore SimpleTest multi-site environment.
# simpletest
@@ -1,155 +0,0 @@
<?php
// @codingStandardsIgnoreFile
/**
* @file
* Local development override configuration feature.
*
* To activate this feature, copy and rename it such that its path plus
* filename is 'sites/default/settings.local.php'. Then, go to the bottom of
* 'sites/default/settings.php' and uncomment the commented lines that mention
* 'settings.local.php'.
*
* If you are using a site name in the path, such as 'sites/example.com', copy
* this file to 'sites/example.com/settings.local.php', and uncomment the lines
* at the bottom of 'sites/example.com/settings.php'.
*/
/**
* Assertions.
*
* The Drupal project primarily uses runtime assertions to enforce the
* expectations of the API by failing when incorrect calls are made by code
* under development.
*
* @see http://php.net/assert
* @see https://www.drupal.org/node/2492225
*
* If you are using PHP 7.0 it is strongly recommended that you set
* zend.assertions=1 in the PHP.ini file (It cannot be changed from .htaccess
* or runtime) on development machines and to 0 in production.
*
* @see https://wiki.php.net/rfc/expectations
*/
assert_options(ASSERT_ACTIVE, TRUE);
\Drupal\Component\Assertion\Handle::register();
/**
* Enable local development services.
*/
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
/**
* Show all error messages, with backtrace information.
*
* In case the error level could not be fetched from the database, as for
* example the database connection failed, we rely only on this value.
*/
$config['system.logging']['error_level'] = 'verbose';
/**
* Disable CSS and JS aggregation.
*/
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
/**
* Disable the render cache.
*
* Note: you should test with the render cache enabled, to ensure the correct
* cacheability metadata is present. However, in the early stages of
* development, you may want to disable it.
*
* This setting disables the render cache by using the Null cache back-end
* defined by the development.services.yml file above.
*
* Only use this setting once the site has been installed.
*/
# $settings['cache']['bins']['render'] = 'cache.backend.null';
/**
* Disable caching for migrations.
*
* Uncomment the code below to only store migrations in memory and not in the
* database. This makes it easier to develop custom migrations.
*/
# $settings['cache']['bins']['discovery_migration'] = 'cache.backend.memory';
/**
* Disable Internal Page Cache.
*
* Note: you should test with Internal Page Cache enabled, to ensure the correct
* cacheability metadata is present. However, in the early stages of
* development, you may want to disable it.
*
* This setting disables the page cache by using the Null cache back-end
* defined by the development.services.yml file above.
*
* Only use this setting once the site has been installed.
*/
# $settings['cache']['bins']['page'] = 'cache.backend.null';
/**
* Disable Dynamic Page Cache.
*
* Note: you should test with Dynamic Page Cache enabled, to ensure the correct
* cacheability metadata is present (and hence the expected behavior). However,
* in the early stages of development, you may want to disable it.
*/
# $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
/**
* Allow test modules and themes to be installed.
*
* Drupal ignores test modules and themes by default for performance reasons.
* During development it can be useful to install test extensions for debugging
* purposes.
*/
# $settings['extension_discovery_scan_tests'] = TRUE;
/**
* Enable access to rebuild.php.
*
* This setting can be enabled to allow Drupal's php and database cached
* storage to be cleared via the rebuild.php page. Access to this page can also
* be gained by generating a query string from rebuild_token_calculator.sh and
* using these parameters in a request to rebuild.php.
*/
$settings['rebuild_access'] = TRUE;
/**
* Skip file system permissions hardening.
*
* The system module will periodically check the permissions of your site's
* site directory to ensure that it is not writable by the website user. For
* sites that are managed with a version control system, this can cause problems
* when files in that directory such as settings.php are updated, because the
* user pulling in the changes won't have permissions to modify files in the
* directory.
*/
$settings['skip_permissions_hardening'] = TRUE;
/**
* Exclude modules from configuration synchronization.
*
* On config export sync, no config or dependent config of any excluded module
* is exported. On config import sync, any config of any installed excluded
* module is ignored. In the exported configuration, it will be as if the
* excluded module had never been installed. When syncing configuration, if an
* excluded module is already installed, it will not be uninstalled by the
* configuration synchronization, and dependent configuration will remain
* intact. This affects only configuration synchronization; single import and
* export of configuration are not affected.
*
* Drupal does not validate or sanity check the list of excluded modules. For
* instance, it is your own responsibility to never exclude required modules,
* because it would mean that the exported configuration can not be imported
* anymore.
*
* This is an advanced feature and using it means opting out of some of the
* guarantees the configuration synchronization provides. It is not recommended
* to use this feature with modules that affect Drupal in a major way such as
* the language or field module.
*/
# $settings['config_exclude_modules'] = ['devel', 'stage_file_proxy'];
@@ -1,57 +0,0 @@
<?php
// @codingStandardsIgnoreFile
/**
* @file
* Configuration file for multi-site support and directory aliasing feature.
*
* This file is required for multi-site support and also allows you to define a
* set of aliases that map hostnames, ports, and pathnames to configuration
* directories in the sites directory. These aliases are loaded prior to
* scanning for directories, and they are exempt from the normal discovery
* rules. See default.settings.php to view how Drupal discovers the
* configuration directory when no alias is found.
*
* Aliases are useful on development servers, where the domain name may not be
* the same as the domain of the live server. Since Drupal stores file paths in
* the database (files, system table, etc.) this will ensure the paths are
* correct when the site is deployed to a live server.
*
* To activate this feature, copy and rename it such that its path plus
* filename is 'sites/sites.php'.
*
* Aliases are defined in an associative array named $sites. The array is
* written in the format: '<port>.<domain>.<path>' => 'directory'. As an
* example, to map https://www.drupal.org:8080/mysite/test to the configuration
* directory sites/example.com, the array should be defined as:
* @code
* $sites = [
* '8080.www.drupal.org.mysite.test' => 'example.com',
* ];
* @endcode
* The URL, https://www.drupal.org:8080/mysite/test/, could be a symbolic link
* or an Apache Alias directive that points to the Drupal root containing
* index.php. An alias could also be created for a subdomain. See the
* @link https://www.drupal.org/documentation/install online Drupal installation guide @endlink
* for more information on setting up domains, subdomains, and subdirectories.
*
* The following examples look for a site configuration in sites/example.com:
* @code
* URL: http://dev.drupal.org
* $sites['dev.drupal.org'] = 'example.com';
*
* URL: http://localhost/example
* $sites['localhost.example'] = 'example.com';
*
* URL: http://localhost:8080/example
* $sites['8080.localhost.example'] = 'example.com';
*
* URL: https://www.drupal.org:8080/mysite/test/
* $sites['8080.www.drupal.org.mysite.test'] = 'example.com';
* @endcode
*
* @see default.settings.php
* @see \Drupal\Core\DrupalKernel::getSitePath()
* @see https://www.drupal.org/documentation/install/multi-site
*/
@@ -1,61 +0,0 @@
# Drupal git normalization
# @see https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
# @see https://www.drupal.org/node/1542048
# Normally these settings would be done with macro attributes for improved
# readability and easier maintenance. However macros can only be defined at the
# repository root directory. Drupal avoids making any assumptions about where it
# is installed.
# Define text file attributes.
# - Treat them as text.
# - Ensure no CRLF line-endings, neither on checkout nor on checkin.
# - Detect whitespace errors.
# - Exposed by default in `git diff --color` on the CLI.
# - Validate with `git diff --check`.
# - Deny applying with `git apply --whitespace=error-all`.
# - Fix automatically with `git apply --whitespace=fix`.
*.config text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.css text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.dist text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.html text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=html
*.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.map text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.po text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.svg text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
# Define binary file attributes.
# - Do not treat them as text.
# - Include binary diff in patches instead of "binary files differ."
*.eot -text diff
*.exe -text diff
*.gif -text diff
*.gz -text diff
*.ico -text diff
*.jpeg -text diff
*.jpg -text diff
*.otf -text diff
*.phar -text diff
*.png -text diff
*.svgz -text diff
*.ttf -text diff
*.woff -text diff
*.woff2 -text diff
@@ -1,65 +0,0 @@
<?php
/**
* @file
* Router script for the built-in PHP web server.
*
* The built-in web server should only be used for development and testing as it
* has a number of limitations that makes running Drupal on it highly insecure
* and somewhat limited.
*
* Note that:
* - The server is single-threaded, any requests made during the execution of
* the main request will hang until the main request has been completed.
* - The web server does not enforce any of the settings in .htaccess in
* particular a remote user will be able to download files that normally would
* be protected from direct access such as .module files.
*
* The router script is needed to work around a bug in PHP, see
* https://bugs.php.net/bug.php?id=61286.
*
* Usage:
* php -S localhost:8888 .ht.router.php
*
* @see http://php.net/manual/en/features.commandline.webserver.php
*/
$url = parse_url($_SERVER['REQUEST_URI']);
if (file_exists(__DIR__ . $url['path'])) {
// Serve the requested resource as-is.
return FALSE;
}
// Work around the PHP bug.
$path = $url['path'];
$script = 'index.php';
if (strpos($path, '.php') !== FALSE) {
// Work backwards through the path to check if a script exists. Otherwise
// fallback to index.php.
do {
$path = dirname($path);
if (preg_match('/\.php$/', $path) && is_file(__DIR__ . $path)) {
// Discovered that the path contains an existing PHP file. Use that as the
// script to include.
$script = ltrim($path, '/');
break;
}
} while ($path !== '/' && $path !== '.');
}
// Update $_SERVER variables to point to the correct index-file.
$index_file_absolute = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $script;
$index_file_relative = DIRECTORY_SEPARATOR . $script;
// SCRIPT_FILENAME will point to the router script itself, it should point to
// the full path of index.php.
$_SERVER['SCRIPT_FILENAME'] = $index_file_absolute;
// SCRIPT_NAME and PHP_SELF will either point to index.php or contain the full
// virtual path being requested depending on the URL being requested. They
// should always point to index.php relative to document root.
$_SERVER['SCRIPT_NAME'] = $index_file_relative;
$_SERVER['PHP_SELF'] = $index_file_relative;
// Require the script and let core take over.
require $_SERVER['SCRIPT_FILENAME'];
-182
View File
@@ -1,182 +0,0 @@
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
</IfModule>
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Set the default handler.
DirectoryIndex index.php index.html index.htm
# Add correct encoding for SVGZ.
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
# Most of the following PHP settings cannot be changed at runtime. See
# sites/default/default.settings.php and
# Drupal\Core\DrupalKernel::bootEnvironment() for settings that can be
# changed at runtime.
# PHP 7, Apache 1 and 2.
<IfModule mod_php7.c>
php_value assert.active 0
</IfModule>
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
<FilesMatch \.php$>
# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off
</FilesMatch>
</IfModule>
# Set a fallback resource if mod_rewrite is not enabled. This allows Drupal to
# work without clean URLs. This requires Apache version >= 2.2.16. If Drupal is
# not accessed by the top level URL (i.e.: http://example.com/drupal/ instead of
# http://example.com/), the path to index.php will need to be adjusted.
<IfModule !mod_rewrite.c>
FallbackResource /index.php
</IfModule>
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# Set "protossl" to "s" if we were accessed via https://. This is used later
# if you enable "www." stripping or enforcement, in order to ensure that
# you don't bounce between http and https.
RewriteRule ^ - [E=protossl]
RewriteCond %{HTTPS} on
RewriteRule ^ - [E=protossl:s]
# Make sure Authorization HTTP header is available to PHP
# even when running as CGI or FastCGI.
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Block access to "hidden" directories whose names begin with a period. This
# includes directories used by version control systems such as Subversion or
# Git to store control files. Files whose names begin with a period, as well
# as the control files used by CVS, are protected by the FilesMatch directive
# above.
#
# NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
# not possible to block access to entire directories from .htaccess because
# <DirectoryMatch> is not allowed here.
#
# If you do not have mod_rewrite installed, you should remove these
# directories from your webroot or otherwise protect them from being
# downloaded.
RewriteRule "/\.|^\.(?!well-known/)" - [F]
# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/foo will be redirected to http://www.example.com/foo)
# uncomment the following:
# RewriteCond %{HTTP_HOST} .
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/foo will be redirected to http://example.com/foo)
# uncomment the following:
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
# Redirect common PHP files to their new locations.
RewriteCond %{REQUEST_URI} ^(.*)?/(install.php) [OR]
RewriteCond %{REQUEST_URI} ^(.*)?/(rebuild.php)
RewriteCond %{REQUEST_URI} !core
RewriteRule ^ %1/core/%2 [L,QSA,R=301]
# Rewrite install.php during installation to see if mod_rewrite is working
RewriteRule ^core/install.php core/install.php?rewrite=ok [QSA,L]
# Pass all requests not referring directly to files in the filesystem to
# index.php.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
# For security reasons, deny access to other PHP files on public sites.
# Note: The following URI conditions are not anchored at the start (^),
# because Drupal may be located in a subdirectory. To further improve
# security, you can replace '!/' with '!^/'.
# Allow access to PHP files in /core (like authorize.php or install.php):
RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$
# Allow access to test-specific PHP files:
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?.php
# Allow access to Statistics module's custom front controller.
# Copy and adapt this rule to directly execute PHP files in contributed or
# custom modules or to run another PHP application in the same directory.
RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$
# Deny access to any other PHP files that do not match the rules above.
# Specifically, disallow autoload.php from being served directly.
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]
# Rules to correctly serve gzip compressed CSS and JS files.
# Requires both mod_rewrite and mod_headers to be enabled.
<IfModule mod_headers.c>
# Serve gzip compressed CSS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
# Serve gzip compressed JS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
# Serve correct content types, and prevent double compression.
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
<FilesMatch "(\.js\.gz|\.css\.gz)$">
# Serve correct encoding type.
Header set Content-Encoding gzip
# Force proxies to cache gzipped & non-gzipped css/js files separately.
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
</IfModule>
# Various header fixes.
<IfModule mod_headers.c>
# Disable content sniffing, since it's an attack vector.
Header always set X-Content-Type-Options nosniff
# Disable Proxy header, since it's an attack vector.
RequestHeader unset Proxy
</IfModule>
-22
View File
@@ -1,22 +0,0 @@
<?php
/**
* @file
* The PHP page that serves all page requests on a Drupal installation.
*
* All Drupal code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
*/
use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;
$autoloader = require_once 'autoload.php';
$kernel = new DrupalKernel('prod', $autoloader);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
@@ -1,42 +0,0 @@
Modules extend your site functionality beyond Drupal core.
WHAT TO PLACE IN THIS DIRECTORY?
--------------------------------
Placing downloaded and custom modules in this directory separates downloaded and
custom modules from Drupal core's modules. This allows Drupal core to be updated
without overwriting these files.
DOWNLOAD ADDITIONAL MODULES
---------------------------
Contributed modules from the Drupal community may be downloaded at
https://www.drupal.org/project/project_module.
ORGANIZING MODULES IN THIS DIRECTORY
------------------------------------
You may create subdirectories in this directory, to organize your added modules,
without breaking the site. Some common subdirectories include "contrib" for
contributed modules, and "custom" for custom modules. Note that if you move a
module to a subdirectory after it has been enabled, you may need to clear the
Drupal cache so it can be found.
There are number of directories that are ignored when looking for modules. These
are 'src', 'lib', 'vendor', 'assets', 'css', 'files', 'images', 'js', 'misc',
'templates', 'includes', 'fixtures' and 'Drupal'.
MULTISITE CONFIGURATION
-----------------------
In multisite configurations, modules found in this directory are available to
all sites. You may also put modules in the sites/all/modules directory, and the
versions in sites/all/modules will take precedence over versions of the same
module that are here. Alternatively, the sites/your_site_name/modules directory
pattern may be used to restrict modules to a specific site instance.
MORE INFORMATION
----------------
Refer to the “Developing for Drupal” section of the README.txt in the Drupal
root directory for further information on extending Drupal with custom modules.
@@ -1,28 +0,0 @@
Installation profiles define additional steps that run after the base
installation of Drupal is completed. They may also offer additional
functionality and change the behavior of the site.
WHAT TO PLACE IN THIS DIRECTORY?
--------------------------------
Place downloaded and custom installation profiles in this directory.
Note that installation profiles are generally provided as part of a Drupal
distribution.
DOWNLOAD ADDITIONAL DISTRIBUTIONS
---------------------------------
Contributed distributions from the Drupal community may be downloaded at
https://www.drupal.org/project/project_distribution.
MULTISITE CONFIGURATION
-----------------------
In multisite configurations, installation profiles found in this directory are
available to all sites during their initial site installation.
MORE INFORMATION
----------------
Refer to the "Installation profiles" section of the README.txt in the Drupal
root directory for further information on extending Drupal with custom profiles.
-61
View File
@@ -1,61 +0,0 @@
#
# robots.txt
#
# This file is to prevent the crawling and indexing of certain parts
# of your site by web crawlers and spiders run by sites like Yahoo!
# and Google. By telling these "robots" where not to go on your site,
# you save bandwidth and server resources.
#
# This file will be ignored unless it is at the root of your host:
# Used: http://example.com/robots.txt
# Ignored: http://example.com/site/robots.txt
#
# For more information about the robots.txt standard, see:
# http://www.robotstxt.org/robotstxt.html
User-agent: *
# CSS, JS, Images
Allow: /core/*.css$
Allow: /core/*.css?
Allow: /core/*.js$
Allow: /core/*.js?
Allow: /core/*.gif
Allow: /core/*.jpg
Allow: /core/*.jpeg
Allow: /core/*.png
Allow: /core/*.svg
Allow: /profiles/*.css$
Allow: /profiles/*.css?
Allow: /profiles/*.js$
Allow: /profiles/*.js?
Allow: /profiles/*.gif
Allow: /profiles/*.jpg
Allow: /profiles/*.jpeg
Allow: /profiles/*.png
Allow: /profiles/*.svg
# Directories
Disallow: /core/
Disallow: /profiles/
# Files
Disallow: /README.txt
Disallow: /web.config
# Paths (clean URLs)
Disallow: /admin/
Disallow: /comment/reply/
Disallow: /filter/tips
Disallow: /node/add/
Disallow: /search/
Disallow: /user/register/
Disallow: /user/password/
Disallow: /user/login/
Disallow: /user/logout/
# Paths (no clean URLs)
Disallow: /index.php/admin/
Disallow: /index.php/comment/reply/
Disallow: /index.php/filter/tips
Disallow: /index.php/node/add/
Disallow: /index.php/search/
Disallow: /index.php/user/password/
Disallow: /index.php/user/register/
Disallow: /index.php/user/login/
Disallow: /index.php/user/logout/
@@ -1,10 +0,0 @@
This directory structure contains the settings and configuration files specific
to your site or sites and is an integral part of multisite configurations.
It is now recommended to place your custom and downloaded extensions in the
/modules, /themes, and /profiles directories located in the Drupal root. The
sites/all/ subdirectory structure, which was recommended in previous versions
of Drupal, is still supported.
See core/INSTALL.txt for information about single-site installation or
multisite configuration.
@@ -1,31 +0,0 @@
Themes allow you to change the look and feel of your Drupal site. You can use
themes contributed by others or create your own.
WHAT TO PLACE IN THIS DIRECTORY?
--------------------------------
Placing downloaded and custom themes in this directory separates downloaded and
custom themes from Drupal core's themes. This allows Drupal core to be updated
without overwriting these files.
DOWNLOAD ADDITIONAL THEMES
--------------------------
Contributed themes from the Drupal community may be downloaded at
https://www.drupal.org/project/project_theme.
MULTISITE CONFIGURATION
-----------------------
In multisite configurations, themes found in this directory are available to
all sites. You may also put themes in the sites/all/themes directory, and the
versions in sites/all/themes will take precedence over versions of the same
themes that are here. Alternatively, the sites/your_site_name/themes directory
pattern may be used to restrict themes to a specific site instance.
MORE INFORMATION
-----------------
Refer to the "Appearance" section of the README.txt in the Drupal root directory
for further information on customizing the appearance of Drupal with custom
themes.
-31
View File
@@ -1,31 +0,0 @@
<?php
/**
* @file
* The PHP page that handles updating the Drupal installation.
*
* All Drupal code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
*/
use Drupal\Core\Update\UpdateKernel;
use Symfony\Component\HttpFoundation\Request;
$autoloader = require_once 'autoload.php';
// Disable garbage collection during test runs. Under certain circumstances the
// update path will create so many objects that garbage collection causes
// segmentation faults.
require_once 'core/includes/bootstrap.inc';
if (drupal_valid_test_ua()) {
gc_collect_cycles();
gc_disable();
}
$kernel = new UpdateKernel('prod', $autoloader, FALSE);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
-103
View File
@@ -1,103 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!-- Don't show directory listings for URLs which map to a directory. -->
<directoryBrowse enabled="false" />
<!--
Caching configuration was not delegated by default. Some hosters may not
delegate the caching configuration to site owners by default and that
may cause errors when users install. Uncomment this if you want to and
are allowed to enable caching.
-->
<!--
<caching>
<profiles>
<add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" />
<add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00" />
</profiles>
</caching>
-->
<rewrite>
<rules>
<rule name="Protect files and directories from prying eyes" stopProcessing="true">
<match url="\.(engine|inc|install|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|composer\.(json|lock)|\.htaccess)$" />
<action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." />
</rule>
<rule name="Force simple error message for requests for non-existent favicon.ico" stopProcessing="true">
<match url="favicon\.ico" />
<action type="CustomResponse" statusCode="404" subStatusCode="1" statusReason="File Not Found" statusDescription="The requested file favicon.ico was not found" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
</rule>
<!-- If running on a PHP version affected by httpoxy vulnerability
uncomment the following rule to mitigate it's impact. To make this
rule work, you will also need to add HTTP_PROXY to the allowed server
variables manually in IIS. See https://www.drupal.org/node/2783079.
<rule name="Erase HTTP_PROXY" patternSyntax="Wildcard">
<match url="*.*" />
<serverVariables>
<set name="HTTP_PROXY" value="" />
</serverVariables>
<action type="None" />
</rule>
-->
<!-- To redirect all users to access the site WITH the 'www.' prefix,
http://example.com/foo will be redirected to http://www.example.com/foo)
adapt and uncomment the following: -->
<!--
<rule name="Redirect to add www" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example\.com$" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="http://www.example.com/{R:1}" />
</rule>
-->
<!-- To redirect all users to access the site WITHOUT the 'www.' prefix,
http://www.example.com/foo will be redirected to http://example.com/foo)
adapt and uncomment the following: -->
<!--
<rule name="Redirect to remove www" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.example\.com$" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="http://example.com/{R:1}" />
</rule>
-->
<!-- Pass all requests not referring directly to files in the filesystem
to index.php. -->
<rule name="Short URLS" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
<!-- If running Windows Server 2008 R2 this can be commented out -->
<!-- httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/index.php" responseMode="ExecuteURL" />
</httpErrors -->
<defaultDocument>
<!-- Set the default document -->
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
-202
View File
@@ -1,202 +0,0 @@
<?php
/**
* @file
* Administrative script for running authorized file operations.
*
* Using this script, the site owner (the user actually owning the files on the
* webserver) can authorize certain file-related operations to proceed with
* elevated privileges, for example to deploy and upgrade modules or themes.
* Users should not visit this page directly, but instead use an administrative
* user interface which knows how to redirect the user to this script as part of
* a multistep process. This script actually performs the selected operations
* without loading all of Drupal, to be able to more gracefully recover from
* errors. Access to the script is controlled by a global killswitch in
* settings.php ('allow_authorize_operations') and via the 'administer software
* updates' permission.
*
* There are helper functions for setting up an operation to run via this
* system in modules/system/system.module. For more information, see:
* @link authorize Authorized operation helper functions @endlink
*/
use Drupal\Core\DrupalKernel;
use Drupal\Core\Form\EnforcedResponseException;
use Drupal\Core\Url;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\Site\Settings;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\Routing\Route;
// Change the directory to the Drupal root.
chdir('..');
$autoloader = require_once 'autoload.php';
/**
* Global flag to identify update.php and authorize.php runs.
*
* Identifies update.php and authorize.php runs, avoiding unwanted operations
* such as css/js preprocessing and translation, and solves some theming issues.
* The flag is checked in other places in Drupal code (not just authorize.php).
*/
const MAINTENANCE_MODE = 'update';
/**
* Determines if the current user is allowed to run authorize.php.
*
* The killswitch in settings.php overrides all else, otherwise, the user must
* have access to the 'administer software updates' permission.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The incoming request.
*
* @return bool
* TRUE if the current user can run authorize.php, and FALSE if not.
*/
function authorize_access_allowed(Request $request) {
$account = \Drupal::service('authentication')->authenticate($request);
if ($account) {
\Drupal::currentUser()->setAccount($account);
}
return Settings::get('allow_authorize_operations', TRUE) && \Drupal::currentUser()->hasPermission('administer software updates');
}
try {
$request = Request::createFromGlobals();
$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod');
$kernel->boot();
// A route is required for route matching.
$request->attributes->set(RouteObjectInterface::ROUTE_OBJECT, new Route('<none>'));
$request->attributes->set(RouteObjectInterface::ROUTE_NAME, '<none>');
$kernel->preHandle($request);
// Ensure our request includes the session if appropriate.
if (PHP_SAPI !== 'cli') {
$request->setSession($kernel->getContainer()->get('session'));
}
}
catch (HttpExceptionInterface $e) {
$response = new Response('', $e->getStatusCode());
$response->prepare($request)->send();
exit;
}
// We have to enable the user and system modules, even to check access and
// display errors via the maintenance theme.
\Drupal::moduleHandler()->addModule('system', 'core/modules/system');
\Drupal::moduleHandler()->addModule('user', 'core/modules/user');
\Drupal::moduleHandler()->load('system');
\Drupal::moduleHandler()->load('user');
// Initialize the maintenance theme for this administrative script.
drupal_maintenance_theme();
$content = [];
$show_messages = TRUE;
$is_allowed = authorize_access_allowed($request);
// Build content.
if ($is_allowed) {
// Load both the Form API and Batch API.
require_once __DIR__ . '/includes/form.inc';
require_once __DIR__ . '/includes/batch.inc';
$page_title = $request->getSession()->get('authorize_page_title', t('Authorize file system changes'));
// See if we've run the operation and need to display a report.
if ($results = $request->getSession()->remove('authorize_results')) {
// Clear the session out.
$request->getSession()->remove('authorize_operation');
$request->getSession()->remove('authorize_filetransfer_info');
if (!empty($results['page_title'])) {
$page_title = $results['page_title'];
}
if (!empty($results['page_message'])) {
\Drupal::messenger()->addMessage($results['page_message']['message'], $results['page_message']['type']);
}
$content['authorize_report'] = [
'#theme' => 'authorize_report',
'#messages' => $results['messages'],
];
if (is_array($results['tasks'])) {
$links = $results['tasks'];
}
else {
// Since this is being called outside of the primary front controller,
// the base_url needs to be set explicitly to ensure that links are
// relative to the site root.
// @todo Simplify with https://www.drupal.org/node/2548095
$default_options = [
'#type' => 'link',
'#options' => [
'absolute' => TRUE,
'base_url' => $GLOBALS['base_url'],
],
];
$links = [
$default_options + [
'#url' => Url::fromRoute('system.admin'),
'#title' => t('Administration pages'),
],
$default_options + [
'#url' => Url::fromRoute('<front>'),
'#title' => t('Front page'),
],
];
}
$content['next_steps'] = [
'#theme' => 'item_list',
'#items' => $links,
'#title' => t('Next steps'),
];
}
// If a batch is running, let it run.
elseif ($request->query->has('batch')) {
$content = _batch_page($request);
// If _batch_page() returns a response object (likely a JsonResponse for
// JavaScript-based batch processing), send it immediately.
if ($content instanceof Response) {
$content->send();
exit;
}
}
else {
if (!$request->getSession()->has('authorize_operation') || !$request->getSession()->has('authorize_filetransfer_info')) {
$content = ['#markup' => t('It appears you have reached this page in error.')];
}
elseif (!$batch = batch_get()) {
// We have a batch to process, show the filetransfer form.
try {
$content = \Drupal::formBuilder()->getForm('Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm');
}
catch (EnforcedResponseException $e) {
$e->getResponse()->send();
exit;
}
}
}
// We defer the display of messages until all operations are done.
$show_messages = !(($batch = batch_get()) && isset($batch['running']));
}
else {
\Drupal::logger('access denied')->warning('authorize.php');
$page_title = t('Access denied');
$content = ['#markup' => t('You are not allowed to access this page.')];
}
$bare_html_page_renderer = \Drupal::service('bare_html_page_renderer');
$response = $bare_html_page_renderer->renderBarePage($content, $page_title, 'maintenance_page', [
'#show_messages' => $show_messages,
]);
if (!$is_allowed) {
$response->setStatusCode(403);
}
$response->send();
-227
View File
@@ -1,227 +0,0 @@
{
"name": "drupal/core",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "drupal-core",
"license": "GPL-2.0-or-later",
"require": {
"ext-date": "*",
"ext-dom": "*",
"ext-filter": "*",
"ext-gd": "*",
"ext-hash": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-PDO": "*",
"ext-session": "*",
"ext-SimpleXML": "*",
"ext-SPL": "*",
"ext-tokenizer": "*",
"ext-xml": "*",
"php": ">=7.0.8",
"symfony/class-loader": "~3.4.0",
"symfony/console": "~3.4.0",
"symfony/dependency-injection": "~3.4.26",
"symfony/event-dispatcher": "~3.4.0",
"symfony/http-foundation": "~3.4.35",
"symfony/http-kernel": "~3.4.14",
"symfony/routing": "~3.4.0",
"symfony/serializer": "~3.4.0",
"symfony/translation": "~3.4.0",
"symfony/validator": "~3.4.0",
"symfony/process": "~3.4.0",
"symfony/polyfill-iconv": "^1.0",
"symfony/yaml": "~3.4.5",
"typo3/phar-stream-wrapper": "^3.1.3",
"twig/twig": "^1.38.2",
"doctrine/common": "^2.7",
"doctrine/annotations": "^1.4",
"guzzlehttp/guzzle": "^6.3",
"symfony-cmf/routing": "^1.4",
"easyrdf/easyrdf": "^0.9",
"laminas/laminas-feed": "^2.12",
"stack/builder": "^1.0",
"egulias/email-validator": "^2.0",
"masterminds/html5": "^2.1",
"symfony/psr-http-message-bridge": "^1.1.2",
"laminas/laminas-diactoros": "^1.8",
"composer/semver": "^1.0",
"asm89/stack-cors": "^1.1",
"pear/archive_tar": "^1.4.9",
"psr/log": "^1.0"
},
"conflict": {
"drupal/pathauto": "<1.6",
"drush/drush": "<8.1.10"
},
"replace": {
"drupal/action": "self.version",
"drupal/aggregator": "self.version",
"drupal/automated_cron": "self.version",
"drupal/bartik": "self.version",
"drupal/ban": "self.version",
"drupal/basic_auth": "self.version",
"drupal/big_pipe": "self.version",
"drupal/block": "self.version",
"drupal/block_content": "self.version",
"drupal/block_place": "self.version",
"drupal/book": "self.version",
"drupal/breakpoint": "self.version",
"drupal/ckeditor": "self.version",
"drupal/claro": "self.version",
"drupal/classy": "self.version",
"drupal/color": "self.version",
"drupal/comment": "self.version",
"drupal/config": "self.version",
"drupal/config_translation": "self.version",
"drupal/contact": "self.version",
"drupal/content_moderation": "self.version",
"drupal/content_translation": "self.version",
"drupal/contextual": "self.version",
"drupal/core-annotation": "self.version",
"drupal/core-assertion": "self.version",
"drupal/core-bridge": "self.version",
"drupal/core-class-finder": "self.version",
"drupal/core-datetime": "self.version",
"drupal/core-dependency-injection": "self.version",
"drupal/core-diff": "self.version",
"drupal/core-discovery": "self.version",
"drupal/core-event-dispatcher": "self.version",
"drupal/core-file-cache": "self.version",
"drupal/core-file-security": "self.version",
"drupal/core-filesystem": "self.version",
"drupal/core-gettext": "self.version",
"drupal/core-graph": "self.version",
"drupal/core-http-foundation": "self.version",
"drupal/core-php-storage": "self.version",
"drupal/core-plugin": "self.version",
"drupal/core-proxy-builder": "self.version",
"drupal/core-render": "self.version",
"drupal/core-serialization": "self.version",
"drupal/core-transliteration": "self.version",
"drupal/core-utility": "self.version",
"drupal/core-uuid": "self.version",
"drupal/core-version": "self.version",
"drupal/datetime": "self.version",
"drupal/datetime_range": "self.version",
"drupal/dblog": "self.version",
"drupal/dynamic_page_cache": "self.version",
"drupal/editor": "self.version",
"drupal/entity_reference": "self.version",
"drupal/field": "self.version",
"drupal/field_layout": "self.version",
"drupal/field_ui": "self.version",
"drupal/file": "self.version",
"drupal/filter": "self.version",
"drupal/forum": "self.version",
"drupal/hal": "self.version",
"drupal/help": "self.version",
"drupal/help_topics": "self.version",
"drupal/history": "self.version",
"drupal/image": "self.version",
"drupal/inline_form_errors": "self.version",
"drupal/jsonapi": "self.version",
"drupal/language": "self.version",
"drupal/layout_builder": "self.version",
"drupal/layout_discovery": "self.version",
"drupal/link": "self.version",
"drupal/locale": "self.version",
"drupal/minimal": "self.version",
"drupal/media": "self.version",
"drupal/media_library": "self.version",
"drupal/menu_link_content": "self.version",
"drupal/menu_ui": "self.version",
"drupal/migrate": "self.version",
"drupal/migrate_drupal": "self.version",
"drupal/migrate_drupal_multilingual": "self.version",
"drupal/migrate_drupal_ui": "self.version",
"drupal/node": "self.version",
"drupal/options": "self.version",
"drupal/page_cache": "self.version",
"drupal/path": "self.version",
"drupal/path_alias": "self.version",
"drupal/quickedit": "self.version",
"drupal/rdf": "self.version",
"drupal/responsive_image": "self.version",
"drupal/rest": "self.version",
"drupal/search": "self.version",
"drupal/serialization": "self.version",
"drupal/settings_tray": "self.version",
"drupal/seven": "self.version",
"drupal/shortcut": "self.version",
"drupal/simpletest": "self.version",
"drupal/standard": "self.version",
"drupal/stark": "self.version",
"drupal/statistics": "self.version",
"drupal/syslog": "self.version",
"drupal/system": "self.version",
"drupal/taxonomy": "self.version",
"drupal/telephone": "self.version",
"drupal/text": "self.version",
"drupal/toolbar": "self.version",
"drupal/tour": "self.version",
"drupal/tracker": "self.version",
"drupal/update": "self.version",
"drupal/user": "self.version",
"drupal/views": "self.version",
"drupal/views_ui": "self.version",
"drupal/workflows": "self.version",
"drupal/workspaces": "self.version"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Drupal\\Core\\": "lib/Drupal/Core",
"Drupal\\Component\\": "lib/Drupal/Component",
"Drupal\\Driver\\": "../drivers/lib/Drupal/Driver"
},
"classmap": [
"lib/Drupal.php",
"lib/Drupal/Component/Utility/Timer.php",
"lib/Drupal/Component/Utility/Unicode.php",
"lib/Drupal/Core/Database/Database.php",
"lib/Drupal/Core/DrupalKernel.php",
"lib/Drupal/Core/DrupalKernelInterface.php",
"lib/Drupal/Core/Site/Settings.php"
]
},
"config": {
"preferred-install": "dist",
"autoloader-suffix": "Drupal8"
},
"extra": {
"drupal-scaffold": {
"file-mapping": {
"[project-root]/.editorconfig": "assets/scaffold/files/editorconfig",
"[project-root]/.gitattributes": "assets/scaffold/files/gitattributes",
"[web-root]/.csslintrc": "assets/scaffold/files/csslintrc",
"[web-root]/.eslintignore": "assets/scaffold/files/eslintignore",
"[web-root]/.eslintrc.json": "assets/scaffold/files/eslintrc.json",
"[web-root]/.ht.router.php": "assets/scaffold/files/ht.router.php",
"[web-root]/.htaccess": "assets/scaffold/files/htaccess",
"[web-root]/example.gitignore": "assets/scaffold/files/example.gitignore",
"[web-root]/index.php": "assets/scaffold/files/index.php",
"[web-root]/INSTALL.txt": "assets/scaffold/files/drupal.INSTALL.txt",
"[web-root]/README.txt": "assets/scaffold/files/drupal.README.txt",
"[web-root]/robots.txt": "assets/scaffold/files/robots.txt",
"[web-root]/update.php": "assets/scaffold/files/update.php",
"[web-root]/web.config": "assets/scaffold/files/web.config",
"[web-root]/sites/README.txt": "assets/scaffold/files/sites.README.txt",
"[web-root]/sites/development.services.yml": "assets/scaffold/files/development.services.yml",
"[web-root]/sites/example.settings.local.php": "assets/scaffold/files/example.settings.local.php",
"[web-root]/sites/example.sites.php": "assets/scaffold/files/example.sites.php",
"[web-root]/sites/default/default.services.yml": "assets/scaffold/files/default.services.yml",
"[web-root]/sites/default/default.settings.php": "assets/scaffold/files/default.settings.php",
"[web-root]/modules/README.txt": "assets/scaffold/files/modules.README.txt",
"[web-root]/profiles/README.txt": "assets/scaffold/files/profiles.README.txt",
"[web-root]/themes/README.txt": "assets/scaffold/files/themes.README.txt"
}
}
},
"scripts": {
"pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
"post-autoload-dump": [
"Drupal\\Core\\Composer\\Composer::ensureHtaccess"
]
}
}
@@ -1,3 +0,0 @@
module: {}
theme: {}
profile: ''
@@ -1 +0,0 @@
definitions: []
@@ -1,832 +0,0 @@
# Base types provided by Drupal core.
# Read https://www.drupal.org/node/1905070 for more details about configuration
# schema, types and type resolution.
# Undefined type used by the system to assign to elements at any level where
# configuration schema is not defined. Using explicitly has the same effect as
# not defining schema, so there is no point in doing that.
undefined:
label: 'Undefined'
class: '\Drupal\Core\Config\Schema\Undefined'
# Explicit type to use when no data typing is possible. Instead of using this
# type, we strongly suggest you use configuration structures that can be
# described with other structural elements of schema, and describe your schema
# with those elements.
ignore:
label: 'Ignore'
class: '\Drupal\Core\Config\Schema\Ignore'
# Basic scalar data types from typed data.
boolean:
label: 'Boolean'
class: '\Drupal\Core\TypedData\Plugin\DataType\BooleanData'
email:
label: 'Email'
class: '\Drupal\Core\TypedData\Plugin\DataType\Email'
integer:
label: 'Integer'
class: '\Drupal\Core\TypedData\Plugin\DataType\IntegerData'
timestamp:
label: 'Timestamp'
class: '\Drupal\Core\TypedData\Plugin\DataType\Timestamp'
float:
label: 'Float'
class: '\Drupal\Core\TypedData\Plugin\DataType\FloatData'
string:
label: 'String'
class: '\Drupal\Core\TypedData\Plugin\DataType\StringData'
uri:
label: 'Uri'
class: '\Drupal\Core\TypedData\Plugin\DataType\Uri'
# Container data types for lists with known and unknown keys.
mapping:
label: Mapping
class: '\Drupal\Core\Config\Schema\Mapping'
definition_class: '\Drupal\Core\TypedData\MapDataDefinition'
sequence:
label: Sequence
class: '\Drupal\Core\Config\Schema\Sequence'
definition_class: '\Drupal\Core\Config\Schema\SequenceDataDefinition'
# Simple extended data types:
# Human readable string that must be plain text and editable with a text field.
label:
type: string
label: 'Label'
translatable: true
# String containing plural variants, separated by EXT.
plural_label:
type: label
label: 'Plural variants'
# Internal Drupal path
path:
type: string
label: 'Path'
# Human readable string that can contain multiple lines of text or HTML.
text:
type: string
label: 'Text'
translatable: true
# A UUID.
uuid:
type: string
label: 'UUID'
constraints:
Uuid: {}
# PHP Date format string that is translatable.
date_format:
type: string
label: 'Date format'
translatable: true
translation context: 'PHP date format'
# HTML color value.
color_hex:
type: string
label: 'Color'
# Complex extended data types:
# Root of a configuration object.
_core_config_info:
type: mapping
mapping:
default_config_hash:
type: string
label: 'Default configuration hash'
config_object:
type: mapping
mapping:
langcode:
type: string
label: 'Language code'
_core:
type: _core_config_info
# Mail text with subject and body parts.
mail:
type: mapping
label: 'Mail'
mapping:
subject:
type: label
label: 'Subject'
body:
type: text
label: 'Body'
# Filter with module and status.
filter:
type: mapping
label: 'Filter'
mapping:
id:
type: string
label: 'ID'
provider:
type: string
label: 'Provider'
status:
type: boolean
label: 'Status'
weight:
type: integer
label: 'Weight'
settings:
type: filter_settings.[%parent.id]
# System action configuration base.
action_configuration_default:
type: sequence
label: 'Action configuration'
sequence:
type: string
theme_settings:
type: config_object
mapping:
favicon:
type: mapping
label: 'Shortcut icon settings'
mapping:
mimetype:
type: string
label: 'MIME type'
path:
type: string
label: 'Path'
url:
type: string
label: 'URL'
use_default:
type: boolean
label: 'Use the default shortcut icon supplied by the theme'
features:
type: mapping
label: 'Optional features'
mapping:
comment_user_picture:
type: boolean
label: 'User pictures in comments'
comment_user_verification:
type: boolean
label: 'User verification status in comments'
favicon:
type: boolean
label: 'Shortcut icon'
logo:
type: boolean
label: 'Logo'
name:
type: boolean
label: 'Site name'
node_user_picture:
type: boolean
label: 'User pictures in posts'
slogan:
type: boolean
label: 'Site slogan'
logo:
type: mapping
label: 'Logo settings'
mapping:
path:
type: string
label: 'Logo path'
url:
type: uri
label: 'URL'
use_default:
type: boolean
label: 'Use default'
third_party_settings:
type: sequence
label: 'Third party settings'
sequence:
type: theme_settings.third_party.[%key]
# Array of routes with route_name and route_params keys.
route:
type: mapping
label: 'Route'
mapping:
route_name:
type: string
label: 'Route Name'
route_params:
type: sequence
label: 'Route Params'
sequence:
type: string
label: 'Param'
# Config dependencies.
config_dependencies_base:
type: mapping
mapping:
config:
type: sequence
label: 'Configuration entity dependencies'
sequence:
type: string
content:
type: sequence
label: 'Content entity dependencies'
sequence:
type: string
module:
type: sequence
label: 'Module dependencies'
sequence:
type: string
theme:
type: sequence
label: 'Theme dependencies'
sequence:
type: string
config_dependencies:
type: config_dependencies_base
label: 'Configuration dependencies'
mapping:
enforced:
type: config_dependencies_base
label: 'Enforced configuration dependencies'
config_entity:
type: mapping
mapping:
uuid:
type: uuid
label: 'UUID'
langcode:
type: string
label: 'Language code'
status:
type: boolean
label: 'Status'
dependencies:
type: config_dependencies
label: 'Dependencies'
third_party_settings:
type: sequence
label: 'Third party settings'
sequence:
type: '[%parent.%parent.%type].third_party.[%key]'
_core:
type: _core_config_info
block.settings.*:
type: block_settings
block_settings:
type: mapping
label: 'Block settings'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'Description'
label_display:
type: string
label: 'Display title'
status:
type: boolean
label: 'Status'
info:
type: label
label: 'Admin info'
view_mode:
type: string
label: 'View mode'
provider:
type: string
label: 'Provider'
context_mapping:
type: sequence
label: 'Context assignments'
sequence:
type: string
condition.plugin:
type: mapping
label: 'Condition'
mapping:
id:
type: string
label: 'ID'
negate:
type: boolean
label: 'Negate'
uuid:
type: uuid
context_mapping:
type: sequence
label: 'Context assignments'
sequence:
type: string
display_variant.plugin:
type: mapping
label: 'Display variant'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'Label'
weight:
type: integer
label: 'Weight'
uuid:
type: uuid
layout_plugin.settings:
type: mapping
label: 'Layout settings'
mapping:
label:
type: label
label: 'Label'
layout_plugin.settings.*:
type: layout_plugin.settings
base_entity_reference_field_settings:
type: mapping
mapping:
target_type:
type: string
label: 'Type of item to reference'
field_config_base:
type: config_entity
mapping:
id:
type: string
label: 'ID'
field_name:
type: string
label: 'Field name'
entity_type:
type: string
label: 'Entity type'
bundle:
type: string
label: 'Bundle'
label:
type: label
label: 'Label'
description:
type: text
label: 'Help text'
required:
type: boolean
label: 'Required field'
translatable:
type: boolean
label: 'Translatable'
default_value:
type: sequence
label: 'Default values'
sequence:
type: field.value.[%parent.%parent.field_type]
label: 'Default value'
default_value_callback:
type: string
label: 'Default value callback'
settings:
type: field.field_settings.[%parent.field_type]
field_type:
type: string
label: 'Field type'
core.base_field_override.*.*.*:
type: field_config_base
label: 'Base field bundle override'
core.date_format.*:
type: config_entity
label: 'Date format'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'Label'
locked:
type: boolean
label: 'Locked'
pattern:
type: core_date_format_pattern.[%parent.locked]
label: 'PHP date format'
# Unlocked date formats should use the translatable type.
core_date_format_pattern.0:
type: date_format
label: 'Date format'
# Locked date formats are just used to transport the value.
core_date_format_pattern.1:
type: string
label: 'Date format'
# Generic field settings schemas.
field.storage_settings.*:
type: mapping
label: 'Settings'
field.field_settings.*:
type: mapping
label: 'Settings'
field.value.*:
type: mapping
label: 'Default value'
# Schema for the configuration of the String field type.
field.storage_settings.string:
type: mapping
label: 'String settings'
mapping:
max_length:
type: integer
label: 'Maximum length'
case_sensitive:
type: boolean
label: 'Case sensitive'
is_ascii:
type: boolean
label: 'Contains US ASCII characters only'
field.field_settings.string:
type: mapping
label: 'String settings'
field.value.string:
type: mapping
label: 'Default value'
mapping:
value:
type: label
label: 'Value'
# Schema for the configuration of the String (long) field type.
field.storage_settings.string_long:
type: mapping
label: 'String (long) settings'
mapping:
case_sensitive:
type: boolean
label: 'Case sensitive'
field.field_settings.string_long:
type: mapping
label: 'String (long) settings'
field.value.string_long:
type: mapping
label: 'Default value'
mapping:
value:
type: text
label: 'Value'
# Schema for the configuration of the URI field type.
field.storage_settings.uri:
type: field.storage_settings.string
label: 'URI settings'
mapping:
max_length:
type: integer
label: 'Maximum length'
case_sensitive:
type: boolean
label: 'Case sensitive'
field.field_settings.uri:
type: mapping
label: 'URI settings'
field.value.uri:
type: mapping
label: 'Default value'
mapping:
value:
type: string
label: 'Value'
# Schema for the configuration of the Created field type.
field.storage_settings.created:
type: mapping
label: 'Created timestamp settings'
field.field_settings.created:
type: mapping
label: 'Created timestamp settings'
field.value.created:
type: mapping
label: 'Default value'
mapping:
value:
type: integer
label: 'Value'
# Schema for the configuration of the Changed field type.
field.storage_settings.changed:
type: mapping
label: 'Changed timestamp settings'
field.field_settings.changed:
type: mapping
label: 'Changed timestamp settings'
field.value.changed:
type: mapping
label: 'Default value'
mapping:
value:
type: integer
label: 'Value'
# Schema for the configuration of the Entity reference field type.
field.storage_settings.entity_reference:
type: mapping
label: 'Entity reference field storage settings'
mapping:
target_type:
type: string
label: 'Type of item to reference'
field.field_settings.entity_reference:
type: mapping
label: 'Entity reference field settings'
mapping:
handler:
type: string
label: 'Reference method'
handler_settings:
type: entity_reference_selection.[%parent.handler]
label: 'Entity reference selection plugin settings'
field.value.entity_reference:
type: mapping
label: 'Default value'
mapping:
target_id:
type: string
label: 'Value'
target_uuid:
type: uuid
# Schema for the configuration of the Boolean field type.
field.field_settings.boolean:
label: 'Boolean settings'
type: mapping
mapping:
on_label:
type: label
label: 'On label'
off_label:
type: label
label: 'Off label'
field.value.boolean:
type: mapping
mapping:
value:
type: integer
label: 'Value'
# Schema for the configuration of the Email field type.
field.storage_settings.email:
type: mapping
label: 'Email settings'
field.field_settings.email:
type: mapping
label: 'Email settings'
sequence:
type: string
label: 'Setting'
field.value.email:
type: mapping
label: 'Default value'
mapping:
value:
type: email
label: 'Value'
# Schema for the configuration of the Integer field type.
field.storage_settings.integer:
type: mapping
label: 'Integer settings'
mapping:
unsigned:
type: boolean
label: 'Unsigned'
size:
type: string
label: 'Database storage size'
field.field_settings.integer:
type: mapping
label: 'Integer'
mapping:
min:
type: integer
label: 'Minimum'
max:
type: integer
label: 'Maximum'
prefix:
type: label
label: 'Prefix'
suffix:
type: label
label: 'Suffix'
field.value.integer:
type: mapping
label: 'Default value'
mapping:
value:
type: integer
label: 'Value'
# Schema for the configuration of the Decimal field type.
field.storage_settings.decimal:
type: mapping
label: 'Decimal settings'
mapping:
precision:
type: integer
label: 'Precision'
scale:
type: integer
label: 'Scale'
field.field_settings.decimal:
type: mapping
label: 'Decimal settings'
mapping:
min:
type: float
label: 'Minimum'
max:
type: float
label: 'Maximum'
prefix:
type: label
label: 'Prefix'
suffix:
type: label
label: 'Suffix'
field.value.decimal:
type: mapping
label: 'Default value'
mapping:
value:
type: float
label: 'Value'
# Schema for the configuration of the Float field type.
field.storage_settings.float:
type: mapping
label: 'Float settings'
field.field_settings.float:
type: mapping
label: 'Float settings'
mapping:
min:
type: float
label: 'Minimum'
max:
type: float
label: 'Maximum'
prefix:
type: label
label: 'Prefix'
suffix:
type: label
label: 'Suffix'
field.value.float:
type: mapping
label: 'Default value'
mapping:
value:
type: float
label: 'Value'
# Schema for the configuration of the Timestamp field type.
field.value.timestamp:
type: mapping
label: 'Timestamp value'
mapping:
value:
type: timestamp
label: 'Value'
# Text with a text format.
text_format:
type: mapping
label: 'Text with text format'
# We declare the entire mapping of text and text format as translatable. This
# causes the entire mapping to be saved to the language overrides of the
# configuration. Storing only the (to be formatted) text could result in
# security problems in case the text format of the source text is changed.
translatable: true
mapping:
value:
type: text
label: 'Text'
# Mark the actual text as translatable (in addition to the entire mapping
# being marked as translatable) so that shipped configuration with
# formatted text can participate in the string translation system.
translatable: true
format:
type: string
label: 'Text format'
# The text format should not be translated as part of the string
# translation system, so this is not marked as translatable.
# Base schema for all entity reference selection handler schemas.
entity_reference_selection:
type: mapping
label: 'Entity reference selection handler settings'
mapping:
target_type:
type: string
label: 'Type of item to reference'
# Schema for all entity reference selection handlers that are not providing a
# specific schema.
entity_reference_selection.*:
type: entity_reference_selection
# Schema for the entity reference 'default' selection handler settings.
entity_reference_selection.default:
type: entity_reference_selection
label: 'Default selection handler settings'
mapping:
target_bundles:
type: sequence
label: 'types'
nullable: true
sequence:
type: string
label: 'Bundle'
sort:
type: mapping
label: 'Sort settings'
mapping:
field:
type: string
label: 'Sort by'
direction:
type: string
label: 'Sort direction'
auto_create:
type: boolean
label: 'Create referenced entities if they don''t already exist'
auto_create_bundle:
type: string
label: 'Bundle assigned to the auto-created entities.'
# Schema for all entity reference 'default:*' selection handlers that are not
# providing a specific schema.
entity_reference_selection.default:*:
type: entity_reference_selection.default
@@ -1,417 +0,0 @@
# Schema for Configuration files of the entity module.
core.entity_view_mode.*.*:
type: config_entity
label: 'Entity view mode settings'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'The human-readable name of the view mode'
targetEntityType:
type: string
label: 'Target entity type'
cache:
type: boolean
label: 'Cached'
core.entity_form_mode.*.*:
type: config_entity
label: 'Entity form mode settings'
mapping:
id:
type: string
label: 'ID'
label:
type: label
label: 'Label'
targetEntityType:
type: string
label: 'Target entity type'
cache:
type: boolean
label: 'Cache'
# Overview configuration information for view mode or form mode displays.
core.entity_view_display.*.*.*:
type: config_entity
label: 'Entity display'
mapping:
id:
type: string
label: 'ID'
targetEntityType:
type: string
label: 'Target entity type'
bundle:
type: string
label: 'Bundle'
mode:
type: string
label: 'View or form mode machine name'
content:
type: sequence
label: 'Field formatters'
sequence:
type: field_formatter.entity_view_display
hidden:
type: sequence
label: 'Field display setting'
sequence:
type: boolean
label: 'Value'
field_formatter:
type: mapping
label: 'Field formatter'
mapping:
type:
type: string
label: 'Format type machine name'
label:
type: string
label: 'Label setting machine name'
settings:
type: field.formatter.settings.[%parent.type]
label: 'Settings'
third_party_settings:
type: sequence
label: 'Third party settings'
sequence:
type: field.formatter.third_party.[%key]
field_formatter.entity_view_display:
type: field_formatter
mapping:
weight:
type: integer
label: 'Weight'
region:
type: string
label: 'Region'
# Overview configuration information for form mode displays.
core.entity_form_display.*.*.*:
type: config_entity
label: 'Entity form display'
mapping:
id:
type: string
label: 'ID'
targetEntityType:
type: string
label: 'Target entity type'
bundle:
type: string
label: 'Bundle'
mode:
type: string
label: 'View or form mode machine name'
status:
type: boolean
label: 'Enabled'
content:
type: sequence
label: 'Field widgets'
sequence:
type: mapping
label: 'Field widget'
mapping:
type:
type: string
label: 'Widget type machine name'
weight:
type: integer
label: 'Weight'
region:
type: string
label: 'Region'
settings:
type: field.widget.settings.[%parent.type]
label: 'Settings'
third_party_settings:
type: sequence
label: 'Third party settings'
sequence:
type: field.widget.third_party.[%key]
hidden:
type: sequence
label: 'Hidden'
sequence:
type: boolean
label: 'Component'
# Default schema for entity display field with undefined type.
field.formatter.settings.*:
type: mapping
# Default schema for entity form display field with undefined type.
field.widget.settings.*:
type: mapping
field.widget.settings.string_textfield:
type: mapping
label: 'Text field display format settings'
mapping:
size:
type: integer
label: 'Size of textfield'
placeholder:
type: label
label: 'Placeholder'
field.widget.settings.string_textarea:
type: mapping
label: 'Textarea display format settings'
mapping:
rows:
type: integer
label: 'Rows'
placeholder:
type: label
label: 'Placeholder'
field.widget.settings.uri:
type: mapping
label: 'URI field'
mapping:
size:
type: integer
label: 'Size of URI field'
placeholder:
type: label
label: 'Placeholder'
field.widget.settings.email_default:
type: mapping
label: 'Email field display format settings'
mapping:
placeholder:
type: label
label: 'Placeholder'
size:
type: integer
label: 'Size of email field'
field.widget.settings.datetime_timestamp:
type: mapping
label: 'Datetime timestamp display format settings'
field.widget.settings.boolean_checkbox:
type: mapping
label: 'Boolean checkbox display format settings'
mapping:
display_label:
type: boolean
label: 'Display label'
field.widget.settings.hidden:
type: mapping
label: '- Hidden - format settings'
field.widget.settings.number:
type: mapping
label: 'Number default display format settings'
mapping:
placeholder:
type: label
label: 'Placeholder'
field.widget.settings.checkbox:
type: mapping
label: 'Single on/off checkbox format settings'
mapping:
display_label:
type: boolean
label: 'Use field label instead of the "On value" as label'
field.widget.settings.entity_reference_autocomplete_tags:
type: mapping
label: 'Entity reference autocomplete (Tags style) display format settings'
mapping:
match_operator:
type: string
label: 'Autocomplete matching'
match_limit:
type: integer
label: 'Maximum number of autocomplete suggestions.'
size:
type: integer
label: 'Size of textfield'
placeholder:
type: label
label: 'Placeholder'
field.widget.settings.entity_reference_autocomplete:
type: mapping
label: 'Entity reference autocomplete display format settings'
mapping:
match_operator:
type: string
label: 'Autocomplete matching'
match_limit:
type: integer
label: 'Maximum number of autocomplete suggestions.'
size:
type: integer
label: 'Size of textfield'
placeholder:
type: label
label: 'Placeholder'
field.formatter.settings.boolean:
type: mapping
mapping:
format:
type: string
label: 'Output format'
format_custom_false:
type: label
label: 'Custom output for FALSE'
format_custom_true:
type: label
label: 'Custom output for TRUE'
field.formatter.settings.string:
type: mapping
mapping:
link_to_entity:
type: boolean
label: 'Link to the entity'
field.formatter.settings.language:
type: field.formatter.settings.string
mapping:
native_language:
type: boolean
label: 'Display in native language'
field.formatter.settings.number_decimal:
type: mapping
label: 'Number decimal display format settings'
mapping:
thousand_separator:
type: string
label: 'Thousand marker'
decimal_separator:
type: string
label: 'Decimal marker'
scale:
type: integer
label: 'Scale'
prefix_suffix:
type: boolean
label: 'Display prefix and suffix.'
field.formatter.settings.number_integer:
type: mapping
label: 'Number integer display format settings'
mapping:
thousand_separator:
type: string
label: 'Thousand marker'
prefix_suffix:
type: boolean
label: 'Display prefix and suffix.'
field.formatter.settings.number_unformatted:
type: mapping
label: 'Number unformatted display format settings'
field.formatter.settings.uri_link:
type: mapping
label: 'URI as link display format settings'
field.formatter.settings.timestamp:
type: mapping
label: 'Timestamp display format settings'
mapping:
date_format:
type: string
label: 'Date format'
custom_date_format:
type: string
label: 'Custom date format'
timezone:
type: string
label: 'Time zone'
field.formatter.settings.timestamp_ago:
type: mapping
label: 'Timestamp ago display format settings'
mapping:
future_format:
type: string
label: 'Future format'
past_format:
type: string
label: 'Past format'
granularity:
type: integer
label: 'Granularity'
field.formatter.settings.entity_reference_entity_view:
type: mapping
label: 'Entity reference rendered entity display format settings'
mapping:
view_mode:
type: string
label: 'View mode'
link:
type: boolean
label: 'Show links'
field.formatter.settings.entity_reference_entity_id:
type: mapping
label: 'Entity reference entity ID display format settings'
field.formatter.settings.entity_reference_label:
type: mapping
label: 'Entity reference label display format settings'
mapping:
link:
type: boolean
label: 'Link label to the referenced entity'
block.settings.field_block:*:*:*:
type: block_settings
mapping:
formatter:
type: field_formatter
# Schema for entity actions.
action.configuration.entity:*:*:
type: action_configuration_default
label: 'Entity action'
action.configuration.action_send_email_action:
type: mapping
label: 'Send email configuration'
mapping:
recipient:
type: string
label: 'Recipient'
subject:
type: label
label: 'Subject'
message:
type: text
label: 'Message'
action.configuration.action_goto_action:
type: mapping
label: 'Redirect to URL configuration'
mapping:
url:
type: string
label: 'URL'
action.configuration.action_message_action:
type: mapping
label: 'Display a message to the user configuration'
mapping:
message:
type: text
label: 'Message'
@@ -1,19 +0,0 @@
core.extension:
type: config_object
label: 'Extension settings'
mapping:
module:
type: sequence
label: 'Enabled modules'
sequence:
type: integer
label: 'Weight'
theme:
type: sequence
label: 'Installed themes'
sequence:
type: integer
label: 'Weight'
profile:
type: string
label: 'Install profile'
@@ -1,26 +0,0 @@
core.menu.static_menu_link_overrides:
type: config_object
label: 'Static menu link overrides'
mapping:
definitions:
type: sequence
label: Definitions
sequence:
type: mapping
label: Definition
mapping:
menu_name:
type: string
label: 'Menu name'
parent:
type: string
label: 'Parent'
weight:
type: integer
label: 'Weight'
expanded:
type: boolean
label: 'Expanded'
enabled:
type: boolean
label: 'Enabled'
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-305
View File
@@ -1,305 +0,0 @@
# Drupal core's extension relation types.
# See https://tools.ietf.org/html/rfc5988#section-4.2.
add-form:
uri: https://drupal.org/link-relations/add-form
description: A form where a resource of this type can be created.
add-page:
uri: https://drupal.org/link-relations/add-page
description: A page where a resource of this type and related types can be created.
delete-form:
uri: https://drupal.org/link-relations/delete-form
description: A form where a resource of this type can be deleted.
delete-multiple-form:
uri: https://drupal.org/link-relations/delete-multiple-form
description: A form where multiple resources of this type can be deleted.
revision:
uri: https://drupal.org/link-relations/revision
description: A particular version of this resource.
create:
uri: https://drupal.org/link-relations/create
description: A REST resource URL where a resource of this type can be created.
enable:
uri: https://drupal.org/link-relations/enable
description: A REST resource URL where a resource of this type can be enabled.
disable:
uri: https://drupal.org/link-relations/disable
description: A REST resource URL where a resource of this type can be disabled.
edit-permissions-form:
uri: https://drupal.org/link-relations/edit-permissions-form
description: A form where permissions assigned to a resource of this type can be edited.
overview-form:
uri: https://drupal.org/link-relations/overview-form
description: A form where an overview of the collection of resources belonging to a resource of this type can be edited in bulk.
reset-form:
uri: https://drupal.org/link-relations/reset-form
description: A form where an overview of the collection of resources belonging to a resource of this type can be reset.
cancel-form:
uri: https://drupal.org/link-relations/cancel-form
description: A form where a resource of this type can be canceled.
flush-form:
uri: https://drupal.org/link-relations/flush-form
description: A form where a resource of this type can be flushed.
duplicate-form:
uri: https://drupal.org/link-relations/duplicate-form
description: A form where a resource of this type can be duplicated.
# All registered relation types.
# See https://tools.ietf.org/html/rfc5988#section-4.1.
# See https://www.iana.org/assignments/link-relations/link-relations.xhtml.
about:
description: "Refers to a resource that is the subject of the link's context."
reference: '[RFC6903], section 2'
alternate:
description: 'Refers to a substitute for this context'
reference: '[http://www.w3.org/TR/html5/links.html#link-type-alternate]'
appendix:
description: 'Refers to an appendix.'
reference: '[http://www.w3.org/TR/1999/REC-html401-19991224]'
archives:
description: "Refers to a collection of records, documents, or other materials of historical interest."
reference: '[http://www.w3.org/TR/2011/WD-html5-20110113/links.html#rel-archives]'
author:
description: "Refers to the context's author."
reference: '[http://www.w3.org/TR/html5/links.html#link-type-author]'
blocked-by:
description: "Identifies the entity that blocks access to a resource following receipt of a legal demand."
reference: '[RFC7725]'
bookmark:
description: 'Gives a permanent link to use for bookmarking purposes.'
reference: '[http://www.w3.org/TR/html5/links.html#link-type-bookmark]'
canonical:
description: 'Designates the preferred version of a resource (the IRI and its contents).'
reference: '[RFC6596]'
chapter:
description: 'Refers to a chapter in a collection of resources.'
reference: '[http://www.w3.org/TR/1999/REC-html401-19991224]'
collection:
description: 'The target IRI points to a resource which represents the collection resource for the context IRI.'
reference: '[RFC6573]'
contents:
description: 'Refers to a table of contents.'
reference: '[http://www.w3.org/TR/1999/REC-html401-19991224]'
copyright:
description: "Refers to a copyright statement that applies to the link's context."
reference: '[http://www.w3.org/TR/1999/REC-html401-19991224]'
create-form:
description: 'The target IRI points to a resource where a submission form can be obtained.'
reference: '[RFC6861]'
current:
description: "Refers to a resource containing the most recent item(s) in a collection of resources."
reference: '[RFC5005]'
customize-form:
description: "The target URI points to a resource where a submission form for customizing associated resource can be obtained."
reference: '[RFC6861]'
derivedfrom:
description: 'The target IRI points to a resource from which this material was derived.'
reference: '[draft-hoffman-xml2rfc]'
describedby:
description: "Refers to a resource providing information about the link's context."
reference: '[http://www.w3.org/TR/powder-dr/#assoc-linking]'
describes:
description: "The relationship A 'describes' B asserts that resource A provides a description of resource B. There are no constraints on the format or representation of either A or B, neither are there any further constraints on either resource."
reference: '[RFC6892]'
notes: "This link relation type is the inverse of the 'describedby' relation type. While 'describedby' establishes a relation from the described resource back to the resource that describes it, 'describes' established a relation from the describing resource to the resource it describes. If B is 'describedby' A, then A 'describes' B."
disclosure:
description: "Refers to a list of patent disclosures made with respect to material for which 'disclosure' relation is specified."
reference: '[RFC6579]'
dns-prefetch:
description: "Used to indicate an origin that will be used to fetch required resources for the link context, and that the user agent ought to resolve as early as possible."
reference: '[https://www.w3.org/TR/resource-hints/]'
duplicate:
description: "Refers to a resource whose available representations are byte-for-byte identical with the corresponding representations of the context IRI."
reference: '[RFC6249]'
notes: "This relation is for static resources. That is, an HTTP GET request on any duplicate will return the same representation. It does not make sense for dynamic or POSTable resources and should not be used for them."
edit:
description: "Refers to a resource that can be used to edit the link's context."
reference: '[RFC5023]'
edit-form:
description: "The target IRI points to a resource where a submission form for editing associated resource can be obtained."
reference: '[RFC6861]'
edit-media:
description: "Refers to a resource that can be used to edit media associated with the link's context."
reference: '[RFC5023]'
enclosure:
description: "Identifies a related resource that is potentially large and might require special handling."
reference: '[RFC4287]'
first:
description: "An IRI that refers to the furthest preceding resource in a series of resources."
reference: '[RFC5988]'
notes: "This relation type registration did not indicate a reference. Originally requested by Mark Nottingham in December 2004."
glossary:
description: 'Refers to a glossary of terms.'
reference: '[http://www.w3.org/TR/1999/REC-html401-19991224]'
help:
description: 'Refers to context-sensitive help.'
reference: '[http://www.w3.org/TR/html5/links.html#link-type-help]'
hosts:
description: "Refers to a resource hosted by the server indicated by the link context."
reference: '[RFC6690]'
notes: "This relation is used in CoRE where links are retrieved as a \"/.well-known/core\" resource representation, and is the default relation type in the CoRE Link Format."
hub:
description: "Refers to a hub that enables registration for notification of updates to the context."
reference: '[http://pubsubhubbub.googlecode.com]'
notes: 'This relation type was requested by Brett Slatkin.'
icon:
description: "Refers to an icon representing the link's context."
reference: '[http://www.w3.org/TR/html5/links.html#link-type-icon]'
index:
description: 'Refers to an index.'
reference: '[http://www.w3.org/TR/1999/REC-html401-19991224]'
item:
description: 'The target IRI points to a resource that is a member of the collection represented by the context IRI.'
reference: '[RFC6573]'
last:
description: "An IRI that refers to the furthest following resource in a series of resources."
reference: '[RFC5988]'
notes: "This relation type registration did not indicate a reference. Originally requested by Mark Nottingham in December 2004."
latest-version:
description: "Points to a resource containing the latest (e.g., current) version of the context."
reference: '[RFC5829]'
license:
description: 'Refers to a license associated with this context.'
reference: '[RFC4946]'
notes: "For implications of use in HTML, see: http://www.w3.org/TR/html5/links.html#link-type-license"
lrdd:
description: "Refers to further information about the link's context, expressed as a LRDD (\"Link-based Resource Descriptor Document\") resource. See [RFC6415] for information about processing this relation type in host-meta documents. When used elsewhere, it refers to additional links and other metadata. Multiple instances indicate additional LRDD resources. LRDD resources MUST have an \"application/xrd+xml\" representation, and MAY have others."
reference: '[RFC6415]'
memento:
description: 'The Target IRI points to a Memento, a fixed resource that will not change state anymore.'
reference: '[RFC7089]'
notes: "A Memento for an Original Resource is a resource that encapsulates a prior state of the Original Resource."
monitor:
description: 'Refers to a resource that can be used to monitor changes in an HTTP resource.'
reference: '[RFC5989]'
monitor-group:
description: 'Refers to a resource that can be used to monitor changes in a specified group of HTTP resources.'
reference: '[RFC5989]'
next:
description: "Indicates that the link's context is a part of a series, and that the next in the series is the link target."
reference: '[http://www.w3.org/TR/html5/links.html#link-type-next]'
next-archive:
description: 'Refers to the immediately following archive resource.'
reference: '[RFC5005]'
nofollow:
description: 'Indicates that the contexts original author or publisher does not endorse the link target.'
reference: '[http://www.w3.org/TR/html5/links.html#link-type-nofollow]'
noreferrer:
description: 'Indicates that no referrer information is to be leaked when following the link.'
reference: '[http://www.w3.org/TR/html5/links.html#link-type-noreferrer]'
original:
description: 'The Target IRI points to an Original Resource.'
reference: '[RFC7089]'
notes: "An Original Resource is a resource that exists or used to exist, and for which access to one of its prior states may be required."
payment:
description: 'Indicates a resource where payment is accepted.'
reference: '[RFC5988]'
notes: "This relation type registration did not indicate a reference. Requested by Joshua Kinberg and Robert Sayre. It is meant as a general way to facilitate acts of payment, and thus this specification makes no assumptions on the type of payment or transaction protocol. Examples may include a web page where donations are accepted or where goods and services are available for purchase. rel=\"payment\" is not intended to initiate an automated transaction. In Atom documents, a link element with a rel=\"payment\" attribute may exist at the feed/channel level and/or the entry/item level. For example, a rel=\"payment\" link at the feed/channel level may point to a \"tip jar\" URI, whereas an entry/ item containing a book review may include a rel=\"payment\" link that points to the location where the book may be purchased through an online retailer."
pingback:
description: 'Gives the address of the pingback resource for the link context.'
reference: '[http://www.hixie.ch/specs/pingback/pingback]'
preconnect:
description: "Used to indicate an origin that will be used to fetch required resources for the link context. Initiating an early connection, which includes the DNS lookup, TCP handshake, and optional TLS negotiation, allows the user agent to mask the high latency costs of establishing a connection."
reference: '[https://www.w3.org/TR/resource-hints/]'
predecessor-version:
description: "Points to a resource containing the predecessor version in the version history."
reference: '[RFC5829]'
prefetch:
description: "The prefetch link relation type is used to identify a resource that might be required by the next navigation from the link context, and that the user agent ought to fetch, such that the user agent can deliver a faster response once the resource is requested in the future."
reference: '[http://www.w3.org/TR/resource-hints/]'
preload:
description: "Refers to a resource that should be loaded early in the processing of the link's context, without blocking rendering."
reference: '[http://www.w3.org/TR/preload/]'
notes: 'Additional target attributes establish the detailed fetch properties of the link.'
prerender:
description: "Used to identify a resource that might be required by the next navigation from the link context, and that the user agent ought to fetch and execute, such that the user agent can deliver a faster response once the resource is requested in the future."
reference: '[https://www.w3.org/TR/resource-hints/]'
prev:
description: "Indicates that the link's context is a part of a series, and that the previous in the series is the link target."
reference: '[http://www.w3.org/TR/html5/links.html#link-type-prev]'
preview:
description: "Refers to a resource that provides a preview of the link's context."
reference: '[RFC6903], section 3'
previous:
description: "Refers to the previous resource in an ordered series of resources. Synonym for \"prev\"."
reference: '[http://www.w3.org/TR/1999/REC-html401-19991224]'
prev-archive:
description: 'Refers to the immediately preceding archive resource.'
reference: '[RFC5005]'
privacy-policy:
description: "Refers to a privacy policy associated with the link's context."
reference: '[RFC6903], section 4'
profile:
description: "Identifying that a resource representation conforms to a certain profile, without affecting the non-profile semantics of the resource representation."
reference: '[RFC6906]'
notes: "Profile URIs are primarily intended to be used as identifiers, and thus clients SHOULD NOT indiscriminately access profile URIs."
related:
description: 'Identifies a related resource.'
reference: '[RFC4287]'
replies:
description: "Identifies a resource that is a reply to the context of the link."
reference: '[RFC4685]'
search:
description: "Refers to a resource that can be used to search through the link's context and related resources."
reference: '[http://www.opensearch.org/Specifications/OpenSearch/1.1]'
section:
description: 'Refers to a section in a collection of resources.'
reference: '[http://www.w3.org/TR/1999/REC-html401-19991224]'
self:
description: "Conveys an identifier for the link's context."
reference: '[RFC4287]'
set-default:
description: "Indicates a URI that can be used to set a resource as the default."
reference: '[RFC5023]'
service:
description: "Indicates a URI that can be used to retrieve a service document."
reference: '[RFC5023]'
notes: "When used in an Atom document, this relation type specifies Atom Publishing Protocol service documents by default. Requested by James Snell."
start:
description: "Refers to the first resource in a collection of resources."
reference: '[http://www.w3.org/TR/1999/REC-html401-19991224]'
stylesheet:
description: 'Refers to a stylesheet.'
reference: '[http://www.w3.org/TR/html5/links.html#link-type-stylesheet]'
subsection:
description: "Refers to a resource serving as a subsection in a collection of resources."
reference: '[http://www.w3.org/TR/1999/REC-html401-19991224]'
successor-version:
description: "Points to a resource containing the successor version in the version history."
reference: '[RFC5829]'
tag:
description: "Gives a tag (identified by the given address) that applies to the current document."
reference: '[http://www.w3.org/TR/html5/links.html#link-type-tag]'
terms-of-service:
description: "Refers to the terms of service associated with the link's context."
reference: '[RFC6903], section 5'
timegate:
description: 'The Target IRI points to a TimeGate for an Original Resource.'
reference: '[RFC7089]'
notes: "A TimeGate for an Original Resource is a resource that is capable of datetime negotiation to support access to prior states of the Original Resource."
timemap:
description: 'The Target IRI points to a TimeMap for an Original Resource.'
reference: '[RFC7089]'
notes: "A TimeMap for an Original Resource is a resource from which a list of URIs of Mementos of the Original Resource is available."
type:
description: "Refers to a resource identifying the abstract semantic type of which the link's context is considered to be an instance."
reference: '[RFC6903], section 6'
up:
description: "Refers to a parent document in a hierarchy of documents."
reference: '[RFC5988]'
notes: "This relation type registration did not indicate a reference. Requested by Noah Slater."
version-history:
description: "Points to a resource containing the version history for the context."
reference: '[RFC5829]'
via:
description: "Identifies a resource that is the source of the information in the link's context."
reference: '[RFC4287]'
webmention:
description: "Identifies a target URI that supports the Webmention protcol. This allows clients that mention a resource in some form of publishing process to contact that endpoint and inform it that this resource has been mentioned."
reference: '[http://www.w3.org/TR/webmention/]'
notes: "This is a similar \"Linkback\" mechanism to the ones of Refback, Trackback, and Pingback. It uses a different protocol, though, and thus should be discoverable through its own link relation type."
working-copy:
description: 'Points to a working copy for this resource.'
reference: '[RFC5829]'
working-copy-of:
description: "Points to the versioned resource from which this working copy was obtained."
reference: '[RFC5829]'
File diff suppressed because it is too large Load Diff
-55
View File
@@ -1,55 +0,0 @@
# This is the DrupalCI testbot build file for Drupal core.
# Learn to make one for your own drupal.org project:
# https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-testing
build:
assessment:
validate_codebase:
phplint:
eslint:
# A test must pass eslinting standards check in order to continue processing.
halt-on-fail: false
phpcs:
# phpcs will use core's specified version of Coder.
sniff-all-files: false
halt-on-fail: false
testing:
# run_tests task is executed several times in order of performance speeds.
# halt-on-fail can be set on the run_tests tasks in order to fail fast.
# suppress-deprecations is false in order to be alerted to usages of
# deprecated code.
run_tests.phpunit:
types: 'PHPUnit-Unit'
testgroups: '--all'
suppress-deprecations: false
halt-on-fail: false
run_tests.kernel:
types: 'PHPUnit-Kernel'
testgroups: '--all'
suppress-deprecations: false
halt-on-fail: false
run_tests.simpletest:
types: 'Simpletest'
testgroups: '--all'
suppress-deprecations: false
halt-on-fail: false
run_tests.build:
# Limit concurrency due to disk space concerns.
concurrency: 15
types: 'PHPUnit-Build'
testgroups: '--all'
suppress-deprecations: false
halt-on-fail: false
run_tests.functional:
types: 'PHPUnit-Functional'
testgroups: '--all'
suppress-deprecations: false
halt-on-fail: false
run_tests.javascript:
concurrency: 15
types: 'PHPUnit-FunctionalJavascript'
testgroups: '--all'
suppress-deprecations: false
halt-on-fail: false
# Run nightwatch testing.
# @see https://www.drupal.org/project/drupal/issues/2869825
nightwatchjs:
-135
View File
@@ -1,135 +0,0 @@
<?php
/**
* @file
* These are the global variables that Drupal uses.
*/
use Drupal\Component\Utility\DeprecatedArray;
/**
* The insecure base URL of the Drupal installation.
*
* @see \Drupal\Core\DrupalKernel::initializeRequestGlobals()
*/
global $base_insecure_url;
/**
* The base path of the Drupal installation.
*
* This will at least default to '/'.
*
* @see \Drupal\Core\DrupalKernel::initializeRequestGlobals()
*/
global $base_path;
/**
* The root URL of the host, excluding the path.
*
* @see \Drupal\Core\DrupalKernel::initializeRequestGlobals()
*/
global $base_root;
/**
* The secure base URL of the Drupal installation.
*
* @see \Drupal\Core\DrupalKernel::initializeRequestGlobals()
*/
global $base_secure_url;
/**
* The base URL of the Drupal installation.
*
* @see \Drupal\Core\DrupalKernel::initializeRequestGlobals()
*/
global $base_url;
/**
* Allows defining of site-specific service providers for the Drupal kernel.
*
* To define a site-specific service provider class, use code like this:
* @code
* $GLOBALS['conf']['container_service_providers']['MyClassName'] = 'Drupal\My\Namespace\MyClassName';
* @endcode
*
* @see \Drupal\Core\DrupalKernel::$serviceProviderClasses
*/
global $conf;
/**
* Array of configuration overrides from the settings.php file.
*/
global $config;
/**
* The location of file system directories used for site configuration data.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Site\Settings::get('config_sync_directory') instead.
*
* @see https://www.drupal.org/node/3018145
*/
global $config_directories;
/**
* Store settings and profile information during installation process.
*
* @see install_drupal()
*/
global $install_state;
/**
* Array of the number of items per page for each pager.
*
* The array index is the pager element index (0 by default).
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Do not
* directly set or get values from this array. Use the pager.manager service
* instead.
*
* @see https://www.drupal.org/node/2779457
* @see \Drupal\Core\Pager\PagerManagerInterface
*/
$GLOBALS['pager_limits'] = new DeprecatedArray([], 'Global variable $pager_limits is deprecated in drupal:8.8.0 and is removed in drupal:9.0.0. Use \Drupal\Core\Pager\PagerManagerInterface instead. See https://www.drupal.org/node/2779457');
/**
* Array of current page numbers for each pager.
*
* The array index is the pager element index (0 by default).
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Do not
* directly set or get values from this array. Use the pager.manager service
* instead.
*
* @see https://www.drupal.org/node/2779457
* @see \Drupal\Core\Pager\PagerManagerInterface
*/
$GLOBALS['pager_page_array'] = new DeprecatedArray([], 'Global variable $pager_page_array is deprecated in drupal:8.8.0 and is removed in drupal:9.0.0. Use \Drupal\Core\Pager\PagerManagerInterface instead. See https://www.drupal.org/node/2779457');
/**
* Array of the total number of pages for each pager.
*
* The array index is the pager element index (0 by default).
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Do not
* directly set or get values from this array. Use the pager.manager service
* instead.
*
* @see https://www.drupal.org/node/2779457
* @see \Drupal\Core\Pager\PagerManagerInterface
*/
$GLOBALS['pager_total'] = new DeprecatedArray([], 'Global variable $pager_total is deprecated in drupal:8.8.0 and is removed in drupal:9.0.0. Use \Drupal\Core\Pager\PagerManagerInterface instead. See https://www.drupal.org/node/2779457');
/**
* Array of the total number of items for each pager.
*
* The array index is the pager element index (0 by default).
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Do not
* directly set or get values from this array. Use the pager.manager service
* instead.
*
* @see https://www.drupal.org/node/2779457
* @see \Drupal\Core\Pager\PagerManagerInterface
*/
$GLOBALS['pager_total_items'] = new DeprecatedArray([], 'Global variable $pager_total_items is deprecated in drupal:8.8.0 and is removed in drupal:9.0.0. Use \Drupal\Core\Pager\PagerManagerInterface instead. See https://www.drupal.org/node/2779457');
-557
View File
@@ -1,557 +0,0 @@
<?php
/**
* @file
* Batch processing API for processes to run in multiple HTTP requests.
*
* Note that batches are usually invoked by form submissions, which is
* why the core interaction functions of the batch processing API live in
* form.inc.
*
* @see form.inc
* @see batch_set()
* @see batch_process()
* @see batch_get()
*/
use Drupal\Component\Utility\Timer;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Batch\Percentage;
use Drupal\Core\Form\FormState;
use Drupal\Core\Url;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
* Renders the batch processing page based on the current state of the batch.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The current request object.
*
* @see _batch_shutdown()
*/
function _batch_page(Request $request) {
$batch = &batch_get();
if (!($request_id = $request->query->get('id'))) {
return FALSE;
}
// Retrieve the current state of the batch.
if (!$batch) {
$batch = \Drupal::service('batch.storage')->load($request_id);
if (!$batch) {
\Drupal::messenger()->addError(t('No active batch.'));
return new RedirectResponse(Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString());
}
}
// We need to store the updated batch information in the batch storage after
// processing the batch. In order for the error page to work correctly this
// needs to be done even in case of a PHP fatal error in which case the end of
// this function is never reached. Therefore we register a shutdown function
// to handle this case. Because with FastCGI and fastcgi_finish_request()
// shutdown functions are called after the HTTP connection is closed, updating
// the batch information in a shutdown function would lead to race conditions
// between consecutive requests if the batch processing continues. In case of
// a fatal error the processing stops anyway, so it works even with FastCGI.
// However, we must ensure to only update in the shutdown phase in this
// particular case we track whether the batch information still needs to be
// updated.
// @see _batch_shutdown()
// @see \Symfony\Component\HttpFoundation\Response::send()
drupal_register_shutdown_function('_batch_shutdown');
_batch_needs_update(TRUE);
$build = [];
// Add batch-specific libraries.
foreach ($batch['sets'] as $batch_set) {
if (isset($batch_set['library'])) {
foreach ($batch_set['library'] as $library) {
$build['#attached']['library'][] = $library;
}
}
}
$op = $request->query->get('op', '');
switch ($op) {
case 'start':
case 'do_nojs':
// Display the full progress page on startup and on each additional
// non-JavaScript iteration.
$current_set = _batch_current_set();
$build['#title'] = $current_set['title'];
$build['content'] = _batch_progress_page();
$response = $build;
break;
case 'do':
// JavaScript-based progress page callback.
$response = _batch_do();
break;
case 'finished':
// _batch_finished() returns a RedirectResponse.
$response = _batch_finished();
break;
}
if ($batch) {
\Drupal::service('batch.storage')->update($batch);
}
_batch_needs_update(FALSE);
return $response;
}
/**
* Checks whether the batch information needs to be updated in the storage.
*
* @param bool $new_value
* (optional) A new value to set.
*
* @return bool
* TRUE if the batch information needs to be updated; FALSE otherwise.
*/
function _batch_needs_update($new_value = NULL) {
$needs_update = &drupal_static(__FUNCTION__, FALSE);
if (isset($new_value)) {
$needs_update = $new_value;
}
return $needs_update;
}
/**
* Does one execution pass with JavaScript and returns progress to the browser.
*
* @see _batch_progress_page_js()
* @see _batch_process()
*/
function _batch_do() {
// Perform actual processing.
list($percentage, $message, $label) = _batch_process();
return new JsonResponse(['status' => TRUE, 'percentage' => $percentage, 'message' => $message, 'label' => $label]);
}
/**
* Outputs a batch processing page.
*
* @see _batch_process()
*/
function _batch_progress_page() {
$batch = &batch_get();
$current_set = _batch_current_set();
$new_op = 'do_nojs';
if (!isset($batch['running'])) {
// This is the first page so we return some output immediately.
$percentage = 0;
$message = $current_set['init_message'];
$label = '';
$batch['running'] = TRUE;
}
else {
// This is one of the later requests; do some processing first.
// Error handling: if PHP dies due to a fatal error (e.g. a nonexistent
// function), it will output whatever is in the output buffer, followed by
// the error message.
ob_start();
$fallback = $current_set['error_message'] . '<br />' . $batch['error_message'];
// We strip the end of the page using a marker in the template, so any
// additional HTML output by PHP shows up inside the page rather than below
// it. While this causes invalid HTML, the same would be true if we didn't,
// as content is not allowed to appear after </html> anyway.
$bare_html_page_renderer = \Drupal::service('bare_html_page_renderer');
$response = $bare_html_page_renderer->renderBarePage(['#markup' => $fallback], $current_set['title'], 'maintenance_page', [
'#show_messages' => FALSE,
]);
// Just use the content of the response.
$fallback = $response->getContent();
list($fallback) = explode('<!--partial-->', $fallback);
print $fallback;
// Perform actual processing.
list($percentage, $message, $label) = _batch_process($batch);
if ($percentage == 100) {
$new_op = 'finished';
}
// PHP did not die; remove the fallback output.
ob_end_clean();
}
// Merge required query parameters for batch processing into those provided by
// batch_set() or hook_batch_alter().
$query_options = $batch['url']->getOption('query');
$query_options['id'] = $batch['id'];
$query_options['op'] = $new_op;
$batch['url']->setOption('query', $query_options);
$url = $batch['url']->toString(TRUE)->getGeneratedUrl();
$build = [
'#theme' => 'progress_bar',
'#percent' => $percentage,
'#message' => ['#markup' => $message],
'#label' => $label,
'#attached' => [
'html_head' => [
[
[
// Redirect through a 'Refresh' meta tag if JavaScript is disabled.
'#tag' => 'meta',
'#noscript' => TRUE,
'#attributes' => [
'http-equiv' => 'Refresh',
'content' => '0; URL=' . $url,
],
],
'batch_progress_meta_refresh',
],
],
// Adds JavaScript code and settings for clients where JavaScript is enabled.
'drupalSettings' => [
'batch' => [
'errorMessage' => $current_set['error_message'] . '<br />' . $batch['error_message'],
'initMessage' => $current_set['init_message'],
'uri' => $url,
],
],
'library' => [
'core/drupal.batch',
],
],
];
return $build;
}
/**
* Processes sets in a batch.
*
* If the batch was marked for progressive execution (default), this executes as
* many operations in batch sets until an execution time of 1 second has been
* exceeded. It will continue with the next operation of the same batch set in
* the next request.
*
* @return array
* An array containing a completion value (in percent) and a status message.
*/
function _batch_process() {
$batch = &batch_get();
$current_set = &_batch_current_set();
// Indicate that this batch set needs to be initialized.
$set_changed = TRUE;
$task_message = '';
// If this batch was marked for progressive execution (e.g. forms submitted by
// \Drupal::formBuilder()->submitForm(), initialize a timer to determine
// whether we need to proceed with the same batch phase when a processing time
// of 1 second has been exceeded.
if ($batch['progressive']) {
Timer::start('batch_processing');
}
if (empty($current_set['start'])) {
$current_set['start'] = microtime(TRUE);
}
$queue = _batch_queue($current_set);
while (!$current_set['success']) {
// If this is the first time we iterate this batch set in the current
// request, we check if it requires an additional file for functions
// definitions.
if ($set_changed && isset($current_set['file']) && is_file($current_set['file'])) {
include_once \Drupal::root() . '/' . $current_set['file'];
}
$task_message = '';
// Assume a single pass operation and set the completion level to 1 by
// default.
$finished = 1;
if ($item = $queue->claimItem()) {
list($callback, $args) = $item->data;
// Build the 'context' array and execute the function call.
$batch_context = [
'sandbox' => &$current_set['sandbox'],
'results' => &$current_set['results'],
'finished' => &$finished,
'message' => &$task_message,
];
call_user_func_array($callback, array_merge($args, [&$batch_context]));
if ($finished >= 1) {
// Make sure this step is not counted twice when computing $current.
$finished = 0;
// Remove the processed operation and clear the sandbox.
$queue->deleteItem($item);
$current_set['count']--;
$current_set['sandbox'] = [];
}
}
// When all operations in the current batch set are completed, browse
// through the remaining sets, marking them 'successfully processed'
// along the way, until we find a set that contains operations.
// _batch_next_set() executes form submit handlers stored in 'control'
// sets (see \Drupal::service('form_submitter')), which can in turn add new
// sets to the batch.
$set_changed = FALSE;
$old_set = $current_set;
while (empty($current_set['count']) && ($current_set['success'] = TRUE) && _batch_next_set()) {
$current_set = &_batch_current_set();
$current_set['start'] = microtime(TRUE);
$set_changed = TRUE;
}
// At this point, either $current_set contains operations that need to be
// processed or all sets have been completed.
$queue = _batch_queue($current_set);
// If we are in progressive mode, break processing after 1 second.
if ($batch['progressive'] && Timer::read('batch_processing') > 1000) {
// Record elapsed wall clock time.
$current_set['elapsed'] = round((microtime(TRUE) - $current_set['start']) * 1000, 2);
break;
}
}
if ($batch['progressive']) {
// Gather progress information.
// Reporting 100% progress will cause the whole batch to be considered
// processed. If processing was paused right after moving to a new set,
// we have to use the info from the new (unprocessed) set.
if ($set_changed && isset($current_set['queue'])) {
// Processing will continue with a fresh batch set.
$remaining = $current_set['count'];
$total = $current_set['total'];
$progress_message = $current_set['init_message'];
$task_message = '';
}
else {
// Processing will continue with the current batch set.
$remaining = $old_set['count'];
$total = $old_set['total'];
$progress_message = $old_set['progress_message'];
}
// Total progress is the number of operations that have fully run plus the
// completion level of the current operation.
$current = $total - $remaining + $finished;
$percentage = _batch_api_percentage($total, $current);
$elapsed = isset($current_set['elapsed']) ? $current_set['elapsed'] : 0;
$values = [
'@remaining' => $remaining,
'@total' => $total,
'@current' => floor($current),
'@percentage' => $percentage,
'@elapsed' => \Drupal::service('date.formatter')->formatInterval($elapsed / 1000),
// If possible, estimate remaining processing time.
'@estimate' => ($current > 0) ? \Drupal::service('date.formatter')->formatInterval(($elapsed * ($total - $current) / $current) / 1000) : '-',
];
$message = strtr($progress_message, $values);
return [$percentage, $message, $task_message];
}
else {
// If we are not in progressive mode, the entire batch has been processed.
return _batch_finished();
}
}
/**
* Formats the percent completion for a batch set.
*
* @param int $total
* The total number of operations.
* @param int|float $current
* The number of the current operation. This may be a floating point number
* rather than an integer in the case of a multi-step operation that is not
* yet complete; in that case, the fractional part of $current represents the
* fraction of the operation that has been completed.
*
* @return string
* The properly formatted percentage, as a string. We output percentages
* using the correct number of decimal places so that we never print "100%"
* until we are finished, but we also never print more decimal places than
* are meaningful.
*
* @see _batch_process()
*/
function _batch_api_percentage($total, $current) {
return Percentage::format($total, $current);
}
/**
* Returns the batch set being currently processed.
*/
function &_batch_current_set() {
$batch = &batch_get();
return $batch['sets'][$batch['current_set']];
}
/**
* Retrieves the next set in a batch.
*
* If there is a subsequent set in this batch, assign it as the new set to
* process and execute its form submit handler (if defined), which may add
* further sets to this batch.
*
* @return true|null
* TRUE if a subsequent set was found in the batch; no value will be returned
* if no subsequent set was found.
*/
function _batch_next_set() {
$batch = &batch_get();
$set_indexes = array_keys($batch['sets']);
$current_set_index_key = array_search($batch['current_set'], $set_indexes);
if (isset($set_indexes[$current_set_index_key + 1])) {
$batch['current_set'] = $set_indexes[$current_set_index_key + 1];
$current_set = &_batch_current_set();
if (isset($current_set['form_submit']) && ($callback = $current_set['form_submit']) && is_callable($callback)) {
// We use our stored copies of $form and $form_state to account for
// possible alterations by previous form submit handlers.
$complete_form = &$batch['form_state']->getCompleteForm();
call_user_func_array($callback, [&$complete_form, &$batch['form_state']]);
}
return TRUE;
}
}
/**
* Ends the batch processing.
*
* Call the 'finished' callback of each batch set to allow custom handling of
* the results and resolve page redirection.
*/
function _batch_finished() {
$batch = &batch_get();
$batch_finished_redirect = NULL;
// Execute the 'finished' callbacks for each batch set, if defined.
foreach ($batch['sets'] as $batch_set) {
if (isset($batch_set['finished'])) {
// Check if the set requires an additional file for function definitions.
if (isset($batch_set['file']) && is_file($batch_set['file'])) {
include_once \Drupal::root() . '/' . $batch_set['file'];
}
if (is_callable($batch_set['finished'])) {
$queue = _batch_queue($batch_set);
$operations = $queue->getAllItems();
$batch_set_result = call_user_func_array($batch_set['finished'], [$batch_set['success'], $batch_set['results'], $operations, \Drupal::service('date.formatter')->formatInterval($batch_set['elapsed'] / 1000)]);
// If a batch 'finished' callback requested a redirect after the batch
// is complete, save that for later use. If more than one batch set
// returned a redirect, the last one is used.
if ($batch_set_result instanceof RedirectResponse) {
$batch_finished_redirect = $batch_set_result;
}
}
}
}
// Clean up the batch table and unset the static $batch variable.
if ($batch['progressive']) {
\Drupal::service('batch.storage')->delete($batch['id']);
foreach ($batch['sets'] as $batch_set) {
if ($queue = _batch_queue($batch_set)) {
$queue->deleteQueue();
}
}
// Clean-up the session. Not needed for CLI updates.
if (isset($_SESSION)) {
unset($_SESSION['batches'][$batch['id']]);
if (empty($_SESSION['batches'])) {
unset($_SESSION['batches']);
}
}
}
$_batch = $batch;
$batch = NULL;
// Redirect if needed.
if ($_batch['progressive']) {
// Revert the 'destination' that was saved in batch_process().
if (isset($_batch['destination'])) {
\Drupal::request()->query->set('destination', $_batch['destination']);
}
// Determine the target path to redirect to. If a batch 'finished' callback
// returned a redirect response object, use that. Otherwise, fall back on
// the form redirection.
if (isset($batch_finished_redirect)) {
return $batch_finished_redirect;
}
elseif (!isset($_batch['form_state'])) {
$_batch['form_state'] = new FormState();
}
if ($_batch['form_state']->getRedirect() === NULL) {
$redirect = $_batch['batch_redirect'] ?: $_batch['source_url'];
// Any path with a scheme does not correspond to a route.
if (!$redirect instanceof Url) {
$options = UrlHelper::parse($redirect);
if (parse_url($options['path'], PHP_URL_SCHEME)) {
$redirect = Url::fromUri($options['path'], $options);
}
else {
$redirect = \Drupal::pathValidator()->getUrlIfValid($options['path']);
if (!$redirect) {
// Stay on the same page if the redirect was invalid.
$redirect = Url::fromRoute('<current>');
}
$redirect->setOptions($options);
}
}
$_batch['form_state']->setRedirectUrl($redirect);
}
// Use \Drupal\Core\Form\FormSubmitterInterface::redirectForm() to handle
// the redirection logic.
$redirect = \Drupal::service('form_submitter')->redirectForm($_batch['form_state']);
if (is_object($redirect)) {
return $redirect;
}
// If no redirection happened, redirect to the originating page. In case the
// form needs to be rebuilt, save the final $form_state for
// \Drupal\Core\Form\FormBuilderInterface::buildForm().
if ($_batch['form_state']->isRebuilding()) {
$_SESSION['batch_form_state'] = $_batch['form_state'];
}
$callback = $_batch['redirect_callback'];
$_batch['source_url']->mergeOptions(['query' => ['op' => 'finish', 'id' => $_batch['id']]]);
if (is_callable($callback)) {
$callback($_batch['source_url'], $_batch['source_url']->getOption('query'));
}
elseif ($callback === NULL) {
// Default to RedirectResponse objects when nothing specified.
return new RedirectResponse($_batch['source_url']->setAbsolute()->toString());
}
}
}
/**
* Shutdown function: Stores the current batch data for the next request.
*
* @see _batch_page()
* @see drupal_register_shutdown_function()
*/
function _batch_shutdown() {
if (($batch = batch_get()) && _batch_needs_update()) {
\Drupal::service('batch.storage')->update($batch);
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-486
View File
@@ -1,486 +0,0 @@
<?php
/**
* @file
* Entity API for handling entities like nodes or users.
*/
use Drupal\Core\Entity\EntityInterface;
/**
* Clears the entity render cache for all entity types.
*
* @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Instead,
* use \Drupal\Core\Entity\EntityViewBuilderInterface::resetCache() on the
* required entity types or invalidate specific cache tags.
*
* @see https://www.drupal.org/node/3000037
* @see \Drupal\Core\Entity\EntityViewBuilderInterface::resetCache()
* @see \Drupal\Core\Entity\EntityTypeManagerInterface::getDefinitions()
*/
function entity_render_cache_clear() {
@trigger_error(__FUNCTION__ . '() is deprecated. Use \Drupal\Core\Entity\EntityViewBuilderInterface::resetCache() on the required entity types or invalidate specific cache tags instead. See https://www.drupal.org/node/3000037', E_USER_DEPRECATED);
$entity_manager = Drupal::entityManager();
foreach ($entity_manager->getDefinitions() as $entity_type => $info) {
if ($entity_manager->hasHandler($entity_type, 'view_builder')) {
$entity_manager->getViewBuilder($entity_type)->resetCache();
}
}
}
/**
* Returns the entity bundle info.
*
* @param string|null $entity_type
* The entity type whose bundle info should be returned, or NULL for all
* bundles info. Defaults to NULL.
*
* @return array
* The bundle info for a specific entity type, or all entity types.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo() for a
* single bundle, or
* \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo() for
* all bundles.
*
* @see https://www.drupal.org/node/3051077
* @see \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo()
* @see \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo()
*/
function entity_get_bundles($entity_type = NULL) {
@trigger_error('entity_get_bundles() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo() for a single bundle, or \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo() for all bundles. See https://www.drupal.org/node/3051077', E_USER_DEPRECATED);
if (isset($entity_type)) {
return \Drupal::entityManager()->getBundleInfo($entity_type);
}
else {
return \Drupal::entityManager()->getAllBundleInfo();
}
}
/**
* Loads an entity from the database.
*
* @param string $entity_type
* The entity type to load, e.g. node or user.
* @param mixed $id
* The id of the entity to load.
* @param bool $reset
* Whether to reset the internal cache for the requested entity type.
*
* @return \Drupal\Core\Entity\EntityInterface|null
* The entity object, or NULL if there is no entity with the given ID.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use the
* entity type storage's load() method.
*
* @see https://www.drupal.org/node/2266845
*/
function entity_load($entity_type, $id, $reset = FALSE) {
@trigger_error('entity_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage\'s load() method. See https://www.drupal.org/node/2266845', E_USER_DEPRECATED);
$controller = \Drupal::entityManager()->getStorage($entity_type);
if ($reset) {
$controller->resetCache([$id]);
}
return $controller->load($id);
}
/**
* Loads an entity from the database.
*
* @param string $entity_type
* The entity type to load, e.g. node or user.
* @param int $revision_id
* The id of the entity to load.
*
* @return \Drupal\Core\Entity\EntityInterface|null
* The entity object, or NULL if there is no entity with the given revision
* id.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use the
* entity type storage's loadRevision() method.
*
* @see https://www.drupal.org/node/1818376
*/
function entity_revision_load($entity_type, $revision_id) {
@trigger_error('entity_revision_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage\'s loadRevision() method. See https://www.drupal.org/node/1818376', E_USER_DEPRECATED);
return \Drupal::entityManager()
->getStorage($entity_type)
->loadRevision($revision_id);
}
/**
* Deletes an entity revision.
*
* @param string $entity_type
* The entity type to load, e.g. node or user.
* @param $revision_id
* The revision ID to delete.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use the
* entity type storage's deleteRevision() method.
*
* @see https://www.drupal.org/node/1818376
*/
function entity_revision_delete($entity_type, $revision_id) {
@trigger_error('entity_revision_delete() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage\'s deleteRevision() method. See https://www.drupal.org/node/1818376', E_USER_DEPRECATED);
\Drupal::entityManager()
->getStorage($entity_type)
->deleteRevision($revision_id);
}
/**
* Loads multiple entities from the database.
*
* This function should be used whenever you need to load more than one entity
* from the database. The entities are loaded into memory and will not require
* database access if loaded again during the same page request.
*
* The actual loading is done through a class that has to implement the
* \Drupal\Core\Entity\EntityStorageInterface interface. By default,
* \Drupal\Core\Entity\Sql\SqlContentEntityStorage is used for content entities
* and Drupal\Core\Config\Entity\ConfigEntityStorage for config entities. Entity
* types can specify that a different class should be used by setting the
* "handlers['storage']" key in the entity plugin annotation. These classes
* can either implement the \Drupal\Core\Entity\EntityStorageInterface
* interface, or, most commonly, extend the
* \Drupal\Core\Entity\Sql\SqlContentEntityStorage class. See
* \Drupal\node\Entity\Node and \Drupal\node\NodeStorage for an example.
*
* @param string $entity_type
* The entity type to load, e.g. node or user.
* @param array $ids
* (optional) An array of entity IDs. If omitted, all entities are loaded.
* @param bool $reset
* Whether to reset the internal cache for the requested entity type.
*
* @return array
* An array of entity objects indexed by their IDs.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use the
* entity type storage's loadMultiple() method.
*
* @see https://www.drupal.org/node/2266845
*/
function entity_load_multiple($entity_type, array $ids = NULL, $reset = FALSE) {
@trigger_error('entity_load_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage\'s loadMultiple() method. See https://www.drupal.org/node/2266845', E_USER_DEPRECATED);
$controller = \Drupal::entityManager()->getStorage($entity_type);
if ($reset) {
$controller->resetCache($ids);
}
return $controller->loadMultiple($ids);
}
/**
* Load entities by their property values.
*
* @param string $entity_type
* The entity type to load, e.g. node or user.
* @param array $values
* An associative array where the keys are the property names and the
* values are the values those properties must have.
*
* @return array
* An array of entity objects indexed by their IDs. Returns an empty array if
* no matching entities are found.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use the
* entity type storage's loadByProperties() method.
*
* @see https://www.drupal.org/node/3050910
*/
function entity_load_multiple_by_properties($entity_type, array $values) {
@trigger_error('entity_load_multiple_by_properties() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage\'s loadByProperties() method. See https://www.drupal.org/node/3050910', E_USER_DEPRECATED);
return \Drupal::entityManager()
->getStorage($entity_type)
->loadByProperties($values);
}
/**
* Loads the unchanged, i.e. not modified, entity from the database.
*
* Unlike entity_load() this function ensures the entity is directly loaded from
* the database, thus bypassing any static cache. In particular, this function
* is useful to determine changes by comparing the entity being saved to the
* stored entity.
*
* @param $entity_type
* The entity type to load, e.g. node or user.
* @param $id
* The ID of the entity to load.
*
* @return \Drupal\Core\Entity\EntityInterface|null
* The unchanged entity, or FALSE if the entity cannot be loaded.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use the
* entity type storage's loadUnchanged() method.
*
* @see https://www.drupal.org/node/1935744
*/
function entity_load_unchanged($entity_type, $id) {
@trigger_error('entity_load_unchanged() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity type storage\'s loadUnchanged() method. See https://www.drupal.org/node/1935744', E_USER_DEPRECATED);
return \Drupal::entityManager()
->getStorage($entity_type)
->loadUnchanged($id);
}
/**
* Deletes multiple entities permanently.
*
* @param string $entity_type
* The type of the entity.
* @param array $ids
* An array of entity IDs of the entities to delete.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
* the entity storage's \Drupal\Core\Entity\EntityStorageInterface::delete()
* method to delete multiple entities:
* @code
* $storage_handler = \Drupal::entityTypeManager()->getStorage($entity_type);
* $entities = $storage_handler->loadMultiple($ids);
* $storage_handler->delete($entities);
* @endcode
*
* @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage()
* @see \Drupal\Core\Entity\EntityStorageInterface::loadMultiple()
* @see \Drupal\Core\Entity\EntityStorageInterface::delete()
* @see https://www.drupal.org/node/3051072
*/
function entity_delete_multiple($entity_type, array $ids) {
@trigger_error(__FUNCTION__ . ' is deprecated in drupal:8.0.0 and will be removed in drupal:9.0.0. Use the entity storage\'s delete() method to delete multiple entities. @see https://www.drupal.org/node/3051072', E_USER_DEPRECATED);
$controller = \Drupal::entityManager()->getStorage($entity_type);
$entities = $controller->loadMultiple($ids);
$controller->delete($entities);
}
/**
* Constructs a new entity object, without permanently saving it.
*
* @param string $entity_type
* The type of the entity.
* @param array $values
* (optional) An array of values to set, keyed by property name. If the
* entity type has bundles, the bundle key has to be specified.
*
* @return \Drupal\Core\Entity\EntityInterface
* A new entity object.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
* The method overriding Entity::create() for the entity type, e.g.
* \Drupal\node\Entity\Node::create() if the entity type is known. If the
* entity type is variable, use the entity storage's create() method to
* construct a new entity:
* @code
* \Drupal::entityTypeManager()->getStorage($entity_type)->create($values);
* @endcode
*
* @see https://www.drupal.org/node/2266845
* @see \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage()
* @see \Drupal\Core\Entity\EntityStorageInterface::create()
*/
function entity_create($entity_type, array $values = []) {
@trigger_error('entity_create() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the create() method of the entity type class directly or \Drupal::entityTypeManager()->getStorage($entity_type)->create($values) instead. See https://www.drupal.org/node/2266845', E_USER_DEPRECATED);
return \Drupal::entityManager()
->getStorage($entity_type)
->create($values);
}
/**
* Returns the label of an entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity for which to generate the label.
* @param $langcode
* (optional) The language code of the language that should be used for
* getting the label. If set to NULL, the entity's default language is
* used.
*
* @return string|null
* The label of the entity, or NULL if there is no label defined.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use the
* entity's label() method.
*
* @see https://www.drupal.org/node/2549923
* @see \Drupal\Core\Entity\EntityInterface::label()
*/
function entity_page_label(EntityInterface $entity, $langcode = NULL) {
@trigger_error('entity_page_label() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use the entity\'s label() method. See https://www.drupal.org/node/2549923', E_USER_DEPRECATED);
return $entity->label($langcode);
}
/**
* Returns the render array for an entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity to be rendered.
* @param string $view_mode
* The view mode that should be used to display the entity.
* @param string $langcode
* (optional) For which language the entity should be rendered, defaults to
* the current content language.
* @param bool $reset
* (optional) Whether to reset the render cache for the requested entity.
* Defaults to FALSE.
*
* @return array
* A render array for the entity.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
* Use the entity view builder's view() method for creating a render array:
* @code
* $view_builder = \Drupal::entityTypeManager()
* ->getViewBuilder($entity->getEntityTypeId());
* return $view_builder->view($entity, $view_mode, $langcode);
* @endcode
*
* @see https://www.drupal.org/node/3033656
* @see \Drupal\Core\Entity\EntityTypeManagerInterface::getViewBuilder()
* @see \Drupal\Core\Entity\EntityViewBuilderInterface::view()
*/
function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $reset = FALSE) {
@trigger_error('entity_view() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager()->getViewBuilder($entity->getEntityTypeId())->view($entity, $view_mode, $langcode) instead. See https://www.drupal.org/node/3033656', E_USER_DEPRECATED);
$render_controller = \Drupal::entityManager()->getViewBuilder($entity->getEntityTypeId());
if ($reset) {
$render_controller->resetCache([$entity]);
}
return $render_controller->view($entity, $view_mode, $langcode);
}
/**
* Returns the render array for the provided entities.
*
* @param \Drupal\Core\Entity\EntityInterface[] $entities
* The entities to be rendered, must be of the same type.
* @param string $view_mode
* The view mode that should be used to display the entity.
* @param string $langcode
* (optional) For which language the entity should be rendered, defaults to
* the current content language.
* @param bool $reset
* (optional) Whether to reset the render cache for the requested entities.
* Defaults to FALSE.
*
* @return array
* A render array for the entities, indexed by the same keys as the
* entities array passed in $entities.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
* Use the entity view builder's viewMultiple() method for creating a render
* array for the provided entities:
* @code
* $view_builder = \Drupal::entityTypeManager()
* ->getViewBuilder($entity->getEntityTypeId());
* return $view_builder->viewMultiple($entities, $view_mode, $langcode);
* @endcode
*
* @see https://www.drupal.org/node/3033656
* @see \Drupal\Core\Entity\EntityTypeManagerInterface::getViewBuilder()
* @see \Drupal\Core\Entity\EntityViewBuilderInterface::viewMultiple()
*/
function entity_view_multiple(array $entities, $view_mode, $langcode = NULL, $reset = FALSE) {
@trigger_error('entity_view_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager()->getViewBuilder($entity->getEntityTypeId())->viewMultiple($entities, $view_mode, $langcode) instead. See https://www.drupal.org/node/3033656', E_USER_DEPRECATED);
$render_controller = \Drupal::entityManager()->getViewBuilder(reset($entities)->getEntityTypeId());
if ($reset) {
$render_controller->resetCache($entities);
}
return $render_controller->viewMultiple($entities, $view_mode, $langcode);
}
/**
* Returns the entity view display associated with a bundle and view mode.
*
* Use this function when assigning suggested display options for a component
* in a given view mode. Note that they will only be actually used at render
* time if the view mode itself is configured to use dedicated display settings
* for the bundle; if not, the 'default' display is used instead.
*
* The function reads the entity view display from the current configuration, or
* returns a ready-to-use empty one if configuration entry exists yet for this
* bundle and view mode. This streamlines manipulation of display objects by
* always returning a consistent object that reflects the current state of the
* configuration.
*
* Example usage:
* - Set the 'body' field to be displayed and the 'field_image' field to be
* hidden on article nodes in the 'default' display.
* @code
* entity_get_display('node', 'article', 'default')
* ->setComponent('body', array(
* 'type' => 'text_summary_or_trimmed',
* 'settings' => array('trim_length' => '200')
* 'weight' => 1,
* ))
* ->removeComponent('field_image')
* ->save();
* @endcode
*
* @param string $entity_type
* The entity type.
* @param string $bundle
* The bundle.
* @param string $view_mode
* The view mode, or 'default' to retrieve the 'default' display object for
* this bundle.
*
* @return \Drupal\Core\Entity\Display\EntityViewDisplayInterface
* The entity view display associated with the view mode.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* EntityDisplayRepositoryInterface::getViewDisplay() instead.
*
* @see https://www.drupal.org/node/2835616
*/
function entity_get_display($entity_type, $bundle, $view_mode) {
@trigger_error('entity_get_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service(\'entity_display.repository\')->getViewDisplay() instead. See https://www.drupal.org/node/2835616', E_USER_DEPRECATED);
return \Drupal::service('entity_display.repository')
->getViewDisplay($entity_type, $bundle, $view_mode);
}
/**
* Returns the entity form display associated with a bundle and form mode.
*
* The function reads the entity form display object from the current
* configuration, or returns a ready-to-use empty one if no configuration entry
* exists yet for this bundle and form mode. This streamlines manipulation of
* entity form displays by always returning a consistent object that reflects
* the current state of the configuration.
*
* Example usage:
* - Set the 'body' field to be displayed with the 'text_textarea_with_summary'
* widget and the 'field_image' field to be hidden on article nodes in the
* 'default' form mode.
* @code
* entity_get_form_display('node', 'article', 'default')
* ->setComponent('body', array(
* 'type' => 'text_textarea_with_summary',
* 'weight' => 1,
* ))
* ->setComponent('field_image', array(
* 'region' => 'hidden',
* ))
* ->save();
* @endcode
*
* @param string $entity_type
* The entity type.
* @param string $bundle
* The bundle.
* @param string $form_mode
* The form mode.
*
* @return \Drupal\Core\Entity\Display\EntityFormDisplayInterface
* The entity form display associated with the given form mode.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* EntityDisplayRepositoryInterface::getFormDisplay() instead.
*
* @see https://www.drupal.org/node/2835616
* @see \Drupal\Core\Entity\EntityStorageInterface::create()
* @see \Drupal\Core\Entity\EntityStorageInterface::load()
*/
function entity_get_form_display($entity_type, $bundle, $form_mode) {
@trigger_error('entity_get_form_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service(\'entity_display.repository\')->getFormDisplay() instead. See https://www.drupal.org/node/2835616', E_USER_DEPRECATED);
return \Drupal::service('entity_display.repository')
->getFormDisplay($entity_type, $bundle, $form_mode);
}
-365
View File
@@ -1,365 +0,0 @@
<?php
/**
* @file
* Functions for error handling.
*/
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Installer\InstallerKernel;
use Drupal\Core\Logger\RfcLogLevel;
use Drupal\Core\Render\Markup;
use Drupal\Core\Utility\Error;
use Symfony\Component\HttpFoundation\Response;
/**
* Maps PHP error constants to watchdog severity levels.
*
* The error constants are documented at
* http://php.net/manual/errorfunc.constants.php
*
* @ingroup logging_severity_levels
*/
function drupal_error_levels() {
$types = [
E_ERROR => ['Error', RfcLogLevel::ERROR],
E_WARNING => ['Warning', RfcLogLevel::WARNING],
E_PARSE => ['Parse error', RfcLogLevel::ERROR],
E_NOTICE => ['Notice', RfcLogLevel::NOTICE],
E_CORE_ERROR => ['Core error', RfcLogLevel::ERROR],
E_CORE_WARNING => ['Core warning', RfcLogLevel::WARNING],
E_COMPILE_ERROR => ['Compile error', RfcLogLevel::ERROR],
E_COMPILE_WARNING => ['Compile warning', RfcLogLevel::WARNING],
E_USER_ERROR => ['User error', RfcLogLevel::ERROR],
E_USER_WARNING => ['User warning', RfcLogLevel::WARNING],
E_USER_NOTICE => ['User notice', RfcLogLevel::NOTICE],
E_STRICT => ['Strict warning', RfcLogLevel::DEBUG],
E_RECOVERABLE_ERROR => ['Recoverable fatal error', RfcLogLevel::ERROR],
E_DEPRECATED => ['Deprecated function', RfcLogLevel::DEBUG],
E_USER_DEPRECATED => ['User deprecated function', RfcLogLevel::DEBUG],
];
return $types;
}
/**
* Provides custom PHP error handling.
*
* @param $error_level
* The level of the error raised.
* @param $message
* The error message.
* @param $filename
* The filename that the error was raised in.
* @param $line
* The line number the error was raised at.
* @param $context
* An array that points to the active symbol table at the point the error
* occurred.
*/
function _drupal_error_handler_real($error_level, $message, $filename, $line, $context) {
if ($error_level & error_reporting()) {
$types = drupal_error_levels();
list($severity_msg, $severity_level) = $types[$error_level];
$backtrace = debug_backtrace();
$caller = Error::getLastCaller($backtrace);
// We treat recoverable errors as fatal.
$recoverable = $error_level == E_RECOVERABLE_ERROR;
// As __toString() methods must not throw exceptions (recoverable errors)
// in PHP, we allow them to trigger a fatal error by emitting a user error
// using trigger_error().
$to_string = $error_level == E_USER_ERROR && substr($caller['function'], -strlen('__toString()')) == '__toString()';
_drupal_log_error([
'%type' => isset($types[$error_level]) ? $severity_msg : 'Unknown error',
// The standard PHP error handler considers that the error messages
// are HTML. We mimick this behavior here.
'@message' => Markup::create(Xss::filterAdmin($message)),
'%function' => $caller['function'],
'%file' => $caller['file'],
'%line' => $caller['line'],
'severity_level' => $severity_level,
'backtrace' => $backtrace,
'@backtrace_string' => (new \Exception())->getTraceAsString(),
], $recoverable || $to_string);
}
// If the site is a test site then fail for user deprecations so they can be
// caught by the deprecation error handler.
elseif (DRUPAL_TEST_IN_CHILD_SITE && $error_level === E_USER_DEPRECATED) {
static $seen = [];
if (array_search($message, $seen, TRUE) === FALSE) {
// Only report each deprecation once. Too many headers can break some
// Chrome and web driver testing.
$seen[] = $message;
$backtrace = debug_backtrace();
$caller = Error::getLastCaller($backtrace);
_drupal_error_header(
Markup::create(Xss::filterAdmin($message)),
'User deprecated function',
$caller['function'],
$caller['file'],
$caller['line']
);
}
}
}
/**
* Determines whether an error should be displayed.
*
* When in maintenance mode or when error_level is ERROR_REPORTING_DISPLAY_ALL,
* all errors should be displayed. For ERROR_REPORTING_DISPLAY_SOME, $error
* will be examined to determine if it should be displayed.
*
* @param $error
* Optional error to examine for ERROR_REPORTING_DISPLAY_SOME.
*
* @return
* TRUE if an error should be displayed.
*/
function error_displayable($error = NULL) {
if (defined('MAINTENANCE_MODE')) {
return TRUE;
}
$error_level = _drupal_get_error_level();
if ($error_level == ERROR_REPORTING_DISPLAY_ALL || $error_level == ERROR_REPORTING_DISPLAY_VERBOSE) {
return TRUE;
}
if ($error_level == ERROR_REPORTING_DISPLAY_SOME && isset($error)) {
return $error['%type'] != 'Notice' && $error['%type'] != 'Strict warning';
}
return FALSE;
}
/**
* Logs a PHP error or exception and displays an error page in fatal cases.
*
* @param $error
* An array with the following keys: %type, @message, %function, %file,
* %line, @backtrace_string, severity_level, and backtrace. All the parameters
* are plain-text, with the exception of @message, which needs to be an HTML
* string, and backtrace, which is a standard PHP backtrace.
* @param bool $fatal
* TRUE for:
* - An exception is thrown and not caught by something else.
* - A recoverable fatal error, which is a fatal error.
* Non-recoverable fatal errors cannot be logged by Drupal.
*/
function _drupal_log_error($error, $fatal = FALSE) {
$is_installer = InstallerKernel::installationAttempted();
// Backtrace array is not a valid replacement value for t().
$backtrace = $error['backtrace'];
unset($error['backtrace']);
// When running inside the testing framework, we relay the errors
// to the tested site by the way of HTTP headers.
if (DRUPAL_TEST_IN_CHILD_SITE && !headers_sent() && (!defined('SIMPLETEST_COLLECT_ERRORS') || SIMPLETEST_COLLECT_ERRORS)) {
_drupal_error_header($error['@message'], $error['%type'], $error['%function'], $error['%file'], $error['%line']);
}
$response = new Response();
// Only call the logger if there is a logger factory available. This can occur
// if there is an error while rebuilding the container or during the
// installer.
if (\Drupal::hasService('logger.factory')) {
try {
// Provide the PHP backtrace to logger implementations.
\Drupal::logger('php')->log($error['severity_level'], '%type: @message in %function (line %line of %file) @backtrace_string.', $error + ['backtrace' => $backtrace]);
}
catch (\Exception $e) {
// We can't log, for example because the database connection is not
// available. At least try to log to PHP error log.
error_log(strtr('Failed to log error: %type: @message in %function (line %line of %file). @backtrace_string', $error));
}
}
// Log fatal errors, so developers can find and debug them.
if ($fatal) {
error_log(sprintf('%s: %s in %s on line %d %s', $error['%type'], $error['@message'], $error['%file'], $error['%line'], $error['@backtrace_string']));
}
if (PHP_SAPI === 'cli') {
if ($fatal) {
// When called from CLI, simply output a plain text message.
// Should not translate the string to avoid errors producing more errors.
$response->setContent(html_entity_decode(strip_tags(new FormattableMarkup('%type: @message in %function (line %line of %file).', $error))) . "\n");
$response->send();
exit(1);
}
}
if (\Drupal::hasRequest() && \Drupal::request()->isXmlHttpRequest()) {
if ($fatal) {
if (error_displayable($error)) {
// When called from JavaScript, simply output the error message.
// Should not translate the string to avoid errors producing more errors.
$response->setContent(new FormattableMarkup('%type: @message in %function (line %line of %file).', $error));
$response->send();
}
exit;
}
}
else {
// Display the message if the current error reporting level allows this type
// of message to be displayed, and unconditionally in update.php.
$message = '';
$class = NULL;
if (error_displayable($error)) {
$class = 'error';
// If error type is 'User notice' then treat it as debug information
// instead of an error message.
// @see debug()
if ($error['%type'] == 'User notice') {
$error['%type'] = 'Debug';
$class = 'status';
}
// Attempt to reduce verbosity by removing DRUPAL_ROOT from the file path
// in the message. This does not happen for (false) security.
if (\Drupal::hasService('app.root')) {
$root_length = strlen(\Drupal::root());
if (substr($error['%file'], 0, $root_length) == \Drupal::root()) {
$error['%file'] = substr($error['%file'], $root_length + 1);
}
}
// Check if verbose error reporting is on.
$error_level = _drupal_get_error_level();
if ($error_level != ERROR_REPORTING_DISPLAY_VERBOSE) {
// Without verbose logging, use a simple message.
// We use \Drupal\Component\Render\FormattableMarkup directly here,
// rather than use t() since we are in the middle of error handling, and
// we don't want t() to cause further errors.
$message = new FormattableMarkup('%type: @message in %function (line %line of %file).', $error);
}
else {
// With verbose logging, we will also include a backtrace.
// First trace is the error itself, already contained in the message.
// While the second trace is the error source and also contained in the
// message, the message doesn't contain argument values, so we output it
// once more in the backtrace.
array_shift($backtrace);
// Generate a backtrace containing only scalar argument values.
$error['@backtrace'] = Error::formatBacktrace($backtrace);
$message = new FormattableMarkup('%type: @message in %function (line %line of %file). <pre class="backtrace">@backtrace</pre>', $error);
}
}
if ($fatal) {
// We fallback to a maintenance page at this point, because the page generation
// itself can generate errors.
// Should not translate the string to avoid errors producing more errors.
$message = 'The website encountered an unexpected error. Please try again later.' . '<br />' . $message;
if ($is_installer) {
// install_display_output() prints the output and ends script execution.
$output = [
'#title' => 'Error',
'#markup' => $message,
];
install_display_output($output, $GLOBALS['install_state'], $response->headers->all());
exit;
}
$response->setContent($message);
$response->setStatusCode(500, '500 Service unavailable (with message)');
$response->send();
// An exception must halt script execution.
exit;
}
if ($message) {
if (\Drupal::hasService('session')) {
// Message display is dependent on sessions being available.
\Drupal::messenger()->addMessage($message, $class, TRUE);
}
else {
print $message;
}
}
}
}
/**
* Returns the current error level.
*
* This function should only be used to get the current error level prior to the
* kernel being booted or before Drupal is installed. In all other situations
* the following code is preferred:
* @code
* \Drupal::config('system.logging')->get('error_level');
* @endcode
*
* @return string
* The current error level.
*/
function _drupal_get_error_level() {
// Raise the error level to maximum for the installer, so users are able to
// file proper bug reports for installer errors. The returned value is
// different to the one below, because the installer actually has a
// 'config.factory' service, which reads the default 'error_level' value from
// System module's default configuration and the default value is not verbose.
// @see error_displayable()
if (InstallerKernel::installationAttempted()) {
return ERROR_REPORTING_DISPLAY_VERBOSE;
}
$error_level = NULL;
// Try to get the error level configuration from database. If this fails,
// for example if the database connection is not there, try to read it from
// settings.php.
try {
$error_level = \Drupal::config('system.logging')->get('error_level');
}
catch (\Exception $e) {
$error_level = isset($GLOBALS['config']['system.logging']['error_level']) ? $GLOBALS['config']['system.logging']['error_level'] : ERROR_REPORTING_HIDE;
}
// If there is no container or if it has no config.factory service, we are
// possibly in an edge-case error situation while trying to serve a regular
// request on a public site, so use the non-verbose default value.
return $error_level ?: ERROR_REPORTING_DISPLAY_ALL;
}
/**
* Adds error information to headers so that tests can access it.
*
* @param $message
* The error message.
* @param $type
* The type of error.
* @param $function
* The function that emitted the error.
* @param $file
* The file that emitted the error.
* @param $line
* The line number in file that emitted the error.
*/
function _drupal_error_header($message, $type, $function, $file, $line) {
// $number does not use drupal_static as it should not be reset
// as it uniquely identifies each PHP error.
static $number = 0;
$assertion = [
$message,
$type,
[
'function' => $function,
'file' => $file,
'line' => $line,
],
];
// For non-fatal errors (e.g. PHP notices) _drupal_log_error can be called
// multiple times per request. In that case the response is typically
// generated outside of the error handler, e.g., in a controller. As a
// result it is not possible to use a Response object here but instead the
// headers need to be emitted directly.
header('X-Drupal-Assertion-' . $number . ': ' . rawurlencode(serialize($assertion)));
$number++;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-187
View File
@@ -1,187 +0,0 @@
<?php
/**
* @file
* API for the Drupal menu system.
*/
/**
* @addtogroup menu
* @{
*/
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Render\Element;
/**
* Prepares variables for single local task link templates.
*
* Default template: menu-local-task.html.twig.
*
* @param array $variables
* An associative array containing:
* - element: A render element containing:
* - #link: A menu link array with 'title', 'url', and (optionally)
* 'localized_options' keys.
* - #active: A boolean indicating whether the local task is active.
*/
function template_preprocess_menu_local_task(&$variables) {
$link = $variables['element']['#link'];
$link += [
'localized_options' => [],
];
$link_text = $link['title'];
if (!empty($variables['element']['#active'])) {
$variables['is_active'] = TRUE;
// Add text to indicate active tab for non-visual users.
$active = new FormattableMarkup('<span class="visually-hidden">@label</span>', ['@label' => t('(active tab)')]);
$link_text = t('@local-task-title@active', ['@local-task-title' => $link_text, '@active' => $active]);
}
$link['localized_options']['set_active_class'] = TRUE;
$variables['link'] = [
'#type' => 'link',
'#title' => $link_text,
'#url' => $link['url'],
'#options' => $link['localized_options'],
];
}
/**
* Prepares variables for single local action link templates.
*
* Default template: menu-local-action.html.twig.
*
* @param array $variables
* An associative array containing:
* - element: A render element containing:
* - #link: A menu link array with 'title', 'url', and (optionally)
* 'localized_options' keys.
*/
function template_preprocess_menu_local_action(&$variables) {
$link = $variables['element']['#link'];
$link += [
'localized_options' => [],
];
$link['localized_options']['attributes']['class'][] = 'button';
$link['localized_options']['attributes']['class'][] = 'button-action';
$link['localized_options']['set_active_class'] = TRUE;
$variables['link'] = [
'#type' => 'link',
'#title' => $link['title'],
'#options' => $link['localized_options'],
'#url' => $link['url'],
];
}
/**
* Returns an array containing the names of system-defined (default) menus.
*/
function menu_list_system_menus() {
return [
'tools' => 'Tools',
'admin' => 'Administration',
'account' => 'User account menu',
'main' => 'Main navigation',
'footer' => 'Footer menu',
];
}
/**
* Collects the local tasks (tabs) for the current route.
*
* @param int $level
* The level of tasks you ask for. Primary tasks are 0, secondary are 1.
*
* @return array
* An array containing
* - tabs: Local tasks for the requested level.
* - route_name: The route name for the current page used to collect the local
* tasks.
*
* @see hook_menu_local_tasks_alter()
* @see https://www.drupal.org/node/2544940
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
*/
function menu_local_tasks($level = 0) {
/** @var \Drupal\Core\Menu\LocalTaskManagerInterface $manager */
$manager = \Drupal::service('plugin.manager.menu.local_task');
return $manager->getLocalTasks(\Drupal::routeMatch()->getRouteName(), $level);
}
/**
* Returns the rendered local tasks at the top level.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Menu\LocalTaskManagerInterface::getLocalTasks() instead.
*
* @see https://www.drupal.org/node/2874695
*/
function menu_primary_local_tasks() {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Menu\LocalTaskManagerInterface::getLocalTasks() instead. See https://www.drupal.org/node/2874695', E_USER_DEPRECATED);
/** @var \Drupal\Core\Menu\LocalTaskManagerInterface $manager */
$manager = \Drupal::service('plugin.manager.menu.local_task');
$links = $manager->getLocalTasks(\Drupal::routeMatch()->getRouteName(), 0);
// Do not display single tabs.
return count(Element::getVisibleChildren($links['tabs'])) > 1 ? $links['tabs'] : '';
}
/**
* Returns the rendered local tasks at the second level.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Menu\LocalTaskManagerInterface::getLocalTasks() instead.
*
* @see https://www.drupal.org/node/2874695
*/
function menu_secondary_local_tasks() {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Menu\LocalTaskManagerInterface::getLocalTasks() instead. See https://www.drupal.org/node/2874695', E_USER_DEPRECATED);
/** @var \Drupal\Core\Menu\LocalTaskManagerInterface $manager */
$manager = \Drupal::service('plugin.manager.menu.local_task');
$links = $manager->getLocalTasks(\Drupal::routeMatch()->getRouteName(), 1);
// Do not display single tabs.
return count(Element::getVisibleChildren($links['tabs'])) > 1 ? $links['tabs'] : '';
}
/**
* Returns a renderable element for the primary and secondary tabs.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* local_tasks_block block or inline theming instead.
*
* @see https://www.drupal.org/node/2874695
*/
function menu_local_tabs() {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use local_tasks_block block or inline theming instead. See https://www.drupal.org/node/2874695', E_USER_DEPRECATED);
$build = [
'#theme' => 'menu_local_tasks',
'#primary' => menu_primary_local_tasks(),
'#secondary' => menu_secondary_local_tasks(),
];
return !empty($build['#primary']) || !empty($build['#secondary']) ? $build : [];
}
/**
* Clears all cached menu data.
*
* This should be called any time broad changes
* might have been made to the router items or menu links.
*
* @deprecated in drupal:8.6.0 and is removed from drupal:9.0.0. Use
* \Drupal::cache('menu')->invalidateAll() instead.
*
* @see https://www.drupal.org/node/2989138
*/
function menu_cache_clear_all() {
@trigger_error("menu_cache_clear_all() is deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Use \Drupal::cache('menu')->invalidateAll() instead. See https://www.drupal.org/node/2989138", E_USER_DEPRECATED);
\Drupal::cache('menu')->invalidateAll();
}
/**
* @} End of "addtogroup menu".
*/
-240
View File
@@ -1,240 +0,0 @@
<?php
/**
* @file
* API for loading and interacting with Drupal modules.
*/
use Drupal\Core\Extension\ExtensionDiscovery;
/**
* Builds a list of installed themes.
*
* @param $type
* The type of list to return:
* - theme: All installed themes.
*
* @return array
* An associative array of themes, keyed by name.
* For $type 'theme', the array values are objects representing the
* respective database row, with the 'info' property already unserialized.
*
* @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use
* \Drupal::service('theme_handler')->listInfo() instead.
*
* @see https://www.drupal.org/node/2709919
* @see \Drupal\Core\Extension\ThemeHandler::listInfo()
*/
function system_list($type) {
@trigger_error('system_list() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal::service(\'theme_handler\')->listInfo() instead. See https://www.drupal.org/node/2709919', E_USER_DEPRECATED);
$lists = [
'theme' => \Drupal::service('theme_handler')->listInfo(),
'filepaths' => [],
];
foreach ($lists['theme'] as $name => $theme) {
$lists['filepaths'][] = [
'type' => 'theme',
'name' => $name,
'filepath' => $theme->getPathname(),
];
}
return $lists[$type];
}
/**
* Resets all system_list() caches.
*
* @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. There
* is no direct replacement. Call each
* \Drupal::service('extension.list.TYPE')->reset() as necessary.
*
* @see https://www.drupal.org/node/2709919
*/
function system_list_reset() {
@trigger_error("system_list_reset() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. There is no direct replacement. Call each \Drupal::service('extension.list.TYPE')->reset() as necessary. See https://www.drupal.org/node/2709919.", E_USER_DEPRECATED);
\Drupal::service('extension.list.profile')->reset();
\Drupal::service('extension.list.module')->reset();
\Drupal::service('extension.list.theme_engine')->reset();
\Drupal::service('extension.list.theme')->reset();
}
/**
* Registers an extension in runtime registries for execution.
*
* @param string $type
* The extension type; e.g., 'module' or 'theme'.
* @param string $name
* The internal name of the extension; e.g., 'node'.
* @param string $uri
* The relative URI of the primary extension file; e.g.,
* 'core/modules/node/node.module'.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. There is
* no replacement for this function. Use the following sequence of code to
* achieve the same functionality:
* @code
* $path = \Drupal::service("extension.list.$type")->getPath($name);
* \Drupal::service('class_loader')->addPsr4('Drupal\\' . $name . '\\', \Drupal::root() . '/' . $path . '/src');
* @endcode
*/
function system_register($type, $name, $uri) {
@trigger_error('system_register() is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. There is no replacement for this function. To achieve the same functionality use this snippet: $path = \Drupal::service("extension.list.$type")->getPath($name); ' . "\\Drupal::service('class_loader')->addPsr4('Drupal\\\\' . \$name . '\\\\', \\Drupal::root() . '/' . \$path . '/src'); See https://www.drupal.org/node/3035275.", E_USER_DEPRECATED);
\Drupal::service('class_loader')->addPsr4('Drupal\\' . $name . '\\', \Drupal::root() . '/' . dirname($uri) . '/src');
}
/**
* Loads a module's installation hooks.
*
* @param $module
* The name of the module (without the .module extension).
*
* @return
* The name of the module's install file, if successful; FALSE otherwise.
*/
function module_load_install($module) {
// Make sure the installation API is available
include_once __DIR__ . '/install.inc';
return module_load_include('install', $module);
}
/**
* Loads a module include file.
*
* Examples:
* @code
* // Load node.admin.inc from the node module.
* module_load_include('inc', 'node', 'node.admin');
* // Load content_types.inc from the node module.
* module_load_include('inc', 'node', 'content_types');
* @endcode
*
* Do not use this function to load an install file, use module_load_install()
* instead. Do not use this function in a global context since it requires
* Drupal to be fully bootstrapped, use require_once DRUPAL_ROOT . '/path/file'
* instead.
*
* @param $type
* The include file's type (file extension).
* @param $module
* The module to which the include file belongs.
* @param $name
* (optional) The base file name (without the $type extension). If omitted,
* $module is used; i.e., resulting in "$module.$type" by default.
*
* @return
* The name of the included file, if successful; FALSE otherwise.
*
* @todo The module_handler service has a loadInclude() method which performs
* this same task but only for enabled modules. Figure out a way to move this
* functionality entirely into the module_handler while keeping the ability to
* load the files of disabled modules.
*/
function module_load_include($type, $module, $name = NULL) {
if (!isset($name)) {
$name = $module;
}
if (function_exists('drupal_get_path')) {
$file = DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "/$name.$type";
if (is_file($file)) {
require_once $file;
return $file;
}
}
return FALSE;
}
/**
* Returns an array of modules required by core.
*/
function drupal_required_modules() {
$listing = new ExtensionDiscovery(\Drupal::root());
$files = $listing->scan('module');
$required = [];
// Unless called by the installer, an installation profile is required and
// must always be loaded.
if ($profile = \Drupal::installProfile()) {
$required[] = $profile;
}
foreach ($files as $name => $file) {
$info = \Drupal::service('info_parser')->parse($file->getPathname());
if (!empty($info) && !empty($info['required']) && $info['required']) {
$required[] = $name;
}
}
return $required;
}
/**
* Sets weight of a particular module.
*
* The weight of uninstalled modules cannot be changed.
*
* @param string $module
* The name of the module (without the .module extension).
* @param int $weight
* An integer representing the weight of the module.
*/
function module_set_weight($module, $weight) {
$extension_config = \Drupal::configFactory()->getEditable('core.extension');
if ($extension_config->get("module.$module") !== NULL) {
// Pre-cast the $weight to an integer so that we can save this without using
// schema. This is a performance improvement for module installation.
$extension_config
->set("module.$module", (int) $weight)
->set('module', module_config_sort($extension_config->get('module')))
->save(TRUE);
// Prepare the new module list, sorted by weight, including filenames.
// @see \Drupal\Core\Extension\ModuleInstaller::install()
$module_handler = \Drupal::moduleHandler();
$current_module_filenames = $module_handler->getModuleList();
$current_modules = array_fill_keys(array_keys($current_module_filenames), 0);
$current_modules = module_config_sort(array_merge($current_modules, $extension_config->get('module')));
$module_filenames = [];
foreach ($current_modules as $name => $weight) {
$module_filenames[$name] = $current_module_filenames[$name];
}
// Update the module list in the extension handler.
$module_handler->setModuleList($module_filenames);
return;
}
}
/**
* Sorts the configured list of enabled modules.
*
* The list of enabled modules is expected to be ordered by weight and name.
* The list is always sorted on write to avoid the overhead on read.
*
* @param array $data
* An array of module configuration data.
*
* @return array
* An array of module configuration data sorted by weight and name.
*/
function module_config_sort($data) {
// PHP array sorting functions such as uasort() do not work with both keys and
// values at the same time, so we achieve weight and name sorting by computing
// strings with both information concatenated (weight first, name second) and
// use that as a regular string sort reference list via array_multisort(),
// compound of "[sign-as-integer][padded-integer-weight][name]"; e.g., given
// two modules and weights (spaces added for clarity):
// - Block with weight -5: 0 0000000000000000005 block
// - Node with weight 0: 1 0000000000000000000 node
$sort = [];
foreach ($data as $name => $weight) {
// Prefix negative weights with 0, positive weights with 1.
// +/- signs cannot be used, since + (ASCII 43) is before - (ASCII 45).
$prefix = (int) ($weight >= 0);
// The maximum weight is PHP_INT_MAX, so pad all weights to 19 digits.
$sort[] = $prefix . sprintf('%019d', abs($weight)) . $name;
}
array_multisort($sort, SORT_STRING, $data);
return $data;
}
-348
View File
@@ -1,348 +0,0 @@
<?php
/**
* @file
* Functions to aid in presenting database results as a set of pages.
*/
use Drupal\Core\Template\Attribute;
use Drupal\Core\Url;
use Drupal\Component\Utility\Html;
/**
* Returns the current page being requested for display within a pager.
*
* @param int $element
* (optional) An integer to distinguish between multiple pagers on one page.
*
* @return int
* The number of the current requested page, within the pager represented by
* $element. This is determined from the URL query parameter
* \Drupal::request()->query->get('page'), or 0 by default. Note that this
* number may differ from the actual page being displayed. For example, if a
* search for "example text" brings up three pages of results, but a user
* visits search/node/example+text?page=10, this function will return 10,
* even though the default pager implementation adjusts for this and still
* displays the third page of search results at that URL.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Pager\PagerParametersInterface->findPage() instead.
*
* @see https://www.drupal.org/node/2779457
* @see \Drupal\Core\Pager\PagerParametersInterface::findPage()
*/
function pager_find_page($element = 0) {
@trigger_error(__FUNCTION__ . ' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Pager\PagerParametersInterface->findPage() instead. See https://www.drupal.org/node/2779457', E_USER_DEPRECATED);
/* @var $pager_parameters \Drupal\Core\Pager\PagerParametersInterface */
$pager_parameters = \Drupal::service('pager.parameters');
return $pager_parameters->findPage($element);
}
/**
* Initializes a pager.
*
* This function sets up the necessary global variables so that the render
* system will correctly process #type 'pager' render arrays to output pagers
* that correspond to the items being displayed.
*
* If the items being displayed result from a database query performed using
* Drupal's database API, and if you have control over the construction of the
* database query, you do not need to call this function directly; instead, you
* can simply extend the query object with the 'PagerSelectExtender' extender
* before executing it. For example:
* @code
* $query = \Drupal::database()->select('some_table')
* ->extend('Drupal\Core\Database\Query\PagerSelectExtender');
* @endcode
*
* However, if you are using a different method for generating the items to be
* paged through, then you should call this function in preparation.
*
* The following example shows how this function can be used in a controller
* that invokes an external datastore with an SQL-like syntax:
* @code
* // First find the total number of items and initialize the pager.
* $where = "status = 1";
* $total = mymodule_select("SELECT COUNT(*) FROM data " . $where)->result();
* $num_per_page = \Drupal::config('mymodule.settings')->get('num_per_page');
* $page = pager_default_initialize($total, $num_per_page);
*
* // Next, retrieve the items for the current page and put them into a
* // render array.
* $offset = $num_per_page * $page;
* $result = mymodule_select("SELECT * FROM data " . $where . " LIMIT %d, %d", $offset, $num_per_page)->fetchAll();
* $render = [];
* $render[] = [
* '#theme' => 'mymodule_results',
* '#result' => $result,
* ];
*
* // Finally, add the pager to the render array, and return.
* $render[] = ['#type' => 'pager'];
* return $render;
* @endcode
*
* A second example involves a controller that invokes an external search
* service where the total number of matching results is provided as part of
* the returned set (so that we do not need a separate query in order to obtain
* this information). Here, we call pager_find_page() to calculate the desired
* offset before the search is invoked:
* @code
* // Perform the query, using the requested offset from pager_find_page().
* // This comes from a URL parameter, so here we are assuming that the URL
* // parameter corresponds to an actual page of results that will exist
* // within the set.
* $page = pager_find_page();
* $num_per_page = \Drupal::config('mymodule.settings')->get('num_per_page');
* $offset = $num_per_page * $page;
* $result = mymodule_remote_search($keywords, $offset, $num_per_page);
*
* // Now that we have the total number of results, initialize the pager.
* pager_default_initialize($result->total, $num_per_page);
*
* // Create a render array with the search results.
* $render = [];
* $render[] = [
* '#theme' => 'search_results',
* '#results' => $result->data,
* '#type' => 'remote',
* ];
*
* // Finally, add the pager to the render array, and return.
* $render[] = ['#type' => 'pager'];
* return $render;
* @endcode
*
* @param int $total
* The total number of items to be paged.
* @param int $limit
* The number of items the calling code will display per page.
* @param int $element
* (optional) An integer to distinguish between multiple pagers on one page.
*
* @return int
* The number of the current page, within the pager represented by $element.
* This is determined from the URL query parameter
* \Drupal::request()->query->get('page), or 0 by default. However, if a page
* that does not correspond to the actual range of the result set was
* requested, this function will return the closest page actually within the
* result set.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Pager\PagerManagerInterface->defaultInitialize() instead.
*
* @see https://www.drupal.org/node/2779457
* @see \Drupal\Core\Pager\PagerManagerInterface::createPager()
*/
function pager_default_initialize($total, $limit, $element = 0) {
@trigger_error(__FUNCTION__ . ' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Pager\PagerManagerInterface->createPager() instead. See https://www.drupal.org/node/2779457', E_USER_DEPRECATED);
/* @var $pager_manager \Drupal\Core\Pager\PagerManagerInterface */
$pager_manager = \Drupal::service('pager.manager');
$pager = $pager_manager->createPager($total, $limit, $element);
return $pager->getCurrentPage();
}
/**
* Compose a URL query parameter array for pager links.
*
* @return array
* A URL query parameter array that consists of all components of the current
* page request except for those pertaining to paging.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Pager\PagerParametersInterface->getQueryParameters() instead.
*
* @see https://www.drupal.org/node/2779457
* @see \Drupal\Core\Pager\PagerParametersInterface::getQueryParameters()
*/
function pager_get_query_parameters() {
@trigger_error(__FUNCTION__ . ' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Pager\PagerParametersInterface->getQueryParameters() instead. See https://www.drupal.org/node/2779457', E_USER_DEPRECATED);
/* @var $pager_params \Drupal\Core\Pager\PagerParametersInterface */
$pager_params = \Drupal::service('pager.parameters');
return $pager_params->getQueryParameters();
}
/**
* Prepares variables for pager templates.
*
* Default template: pager.html.twig.
*
* Menu callbacks that display paged query results should use #type => pager
* to retrieve a pager control so that users can view other results. Format a
* list of nearby pages with additional query results.
*
* @param array $variables
* An associative array containing:
* - pager: A render element containing:
* - #tags: An array of labels for the controls in the pager.
* - #element: An optional integer to distinguish between multiple pagers on
* one page.
* - #parameters: An associative array of query string parameters to append
* to the pager links.
* - #route_parameters: An associative array of the route parameters.
* - #quantity: The number of pages in the list.
*/
function template_preprocess_pager(&$variables) {
$element = $variables['pager']['#element'];
$parameters = $variables['pager']['#parameters'];
$quantity = empty($variables['pager']['#quantity']) ? 0 : $variables['pager']['#quantity'];
$route_name = $variables['pager']['#route_name'];
$route_parameters = isset($variables['pager']['#route_parameters']) ? $variables['pager']['#route_parameters'] : [];
/* @var $pager_manager \Drupal\Core\Pager\PagerManagerInterface */
$pager_manager = \Drupal::service('pager.manager');
$pager = $pager_manager->getPager($element);
// Nothing to do if there is no pager.
if (!isset($pager)) {
return;
}
$pager_max = $pager->getTotalPages();
// Nothing to do if there is only one page.
if ($pager_max <= 1) {
return;
}
$tags = $variables['pager']['#tags'];
// Calculate various markers within this pager piece:
// Middle is used to "center" pages around the current page.
$pager_middle = ceil($quantity / 2);
$current_page = $pager->getCurrentPage();
// The current pager is the page we are currently paged to.
$pager_current = $current_page + 1;
// The first pager is the first page listed by this pager piece (re quantity).
$pager_first = $pager_current - $pager_middle + 1;
// The last is the last page listed by this pager piece (re quantity).
$pager_last = $pager_current + $quantity - $pager_middle;
// End of marker calculations.
// Prepare for generation loop.
$i = $pager_first;
if ($pager_last > $pager_max) {
// Adjust "center" if at end of query.
$i = $i + ($pager_max - $pager_last);
$pager_last = $pager_max;
}
if ($i <= 0) {
// Adjust "center" if at start of query.
$pager_last = $pager_last + (1 - $i);
$i = 1;
}
// End of generation loop preparation.
// Create the "first" and "previous" links if we are not on the first page.
if ($current_page > 0) {
$items['first'] = [];
$items['first']['attributes'] = new Attribute();
$options = [
'query' => $pager_manager->getUpdatedParameters($parameters, $element, 0),
];
$items['first']['href'] = Url::fromRoute($route_name, $route_parameters, $options)->toString();
if (isset($tags[0])) {
$items['first']['text'] = $tags[0];
}
$items['previous'] = [];
$items['previous']['attributes'] = new Attribute();
$options = [
'query' => $pager_manager->getUpdatedParameters($parameters, $element, $current_page - 1),
];
$items['previous']['href'] = Url::fromRoute($route_name, $route_parameters, $options)->toString();
if (isset($tags[1])) {
$items['previous']['text'] = $tags[1];
}
}
if ($i != $pager_max) {
// Add an ellipsis if there are further previous pages.
if ($i > 1) {
$variables['ellipses']['previous'] = TRUE;
}
// Now generate the actual pager piece.
for (; $i <= $pager_last && $i <= $pager_max; $i++) {
$options = [
'query' => $pager_manager->getUpdatedParameters($parameters, $element, $i - 1),
];
$items['pages'][$i]['href'] = Url::fromRoute($route_name, $route_parameters, $options)->toString();
$items['pages'][$i]['attributes'] = new Attribute();
if ($i == $pager_current) {
$variables['current'] = $i;
}
}
// Add an ellipsis if there are further next pages.
if ($i < $pager_max + 1) {
$variables['ellipses']['next'] = TRUE;
}
}
// Create the "next" and "last" links if we are not on the last page.
if ($current_page < ($pager_max - 1)) {
$items['next'] = [];
$items['next']['attributes'] = new Attribute();
$options = [
'query' => $pager_manager->getUpdatedParameters($parameters, $element, $current_page + 1),
];
$items['next']['href'] = Url::fromRoute($route_name, $route_parameters, $options)->toString();
if (isset($tags[3])) {
$items['next']['text'] = $tags[3];
}
$items['last'] = [];
$items['last']['attributes'] = new Attribute();
$options = [
'query' => $pager_manager->getUpdatedParameters($parameters, $element, $pager_max - 1),
];
$items['last']['href'] = Url::fromRoute($route_name, $route_parameters, $options)->toString();
if (isset($tags[4])) {
$items['last']['text'] = $tags[4];
}
}
$variables['items'] = $items;
$variables['heading_id'] = Html::getUniqueId('pagination-heading');
// The rendered link needs to play well with any other query parameter used
// on the page, like exposed filters, so for the cacheability all query
// parameters matter.
$variables['#cache']['contexts'][] = 'url.query_args';
}
/**
* Gets the URL query parameter array of a pager link.
*
* Adds to or adjusts the 'page' URL query parameter so that if you follow the
* link, you'll get page $index for pager $element on the page.
*
* The 'page' URL query parameter is a comma-delimited string, where each value
* is the target content page for the corresponding pager $element. For
* instance, if we have 5 pagers on a single page, and we want to have a link
* to a page that should display the 6th content page for the 3rd pager, and
* the 1st content page for all the other pagers, then the URL query will look
* like this: ?page=0,0,5,0,0 (page numbering starts at zero).
*
* @param array $query
* An associative array of URL query parameters to add to.
* @param int $element
* An integer to distinguish between multiple pagers on one page.
* @param int $index
* The index of the target page, for the given element, in the pager array.
*
* @return array
* The altered $query parameter array.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Pager\PagerManagerInterface::getUpdatedParameters() instead.
*
* @see https://www.drupal.org/node/2779457
* @see \Drupal\Core\Pager\PagerManagerInterface::getUpdatedParameters()
*/
function pager_query_add_page(array $query, $element, $index) {
@trigger_error(__FUNCTION__ . ' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Pager\PagerManagerInterface->getUpdatedParameters() instead. See https://www.drupal.org/node/2779457', E_USER_DEPRECATED);
/* @var $pager_manager \Drupal\Core\Pager\PagerManagerInterface */
$pager_manager = \Drupal::service('pager.manager');
return $pager_manager->getUpdatedParameters($query, $element, $index);
}
-233
View File
@@ -1,233 +0,0 @@
<?php
/**
* @file
* Schema API handling functions.
*/
use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
/**
* @addtogroup schemaapi
* @{
*/
/**
* Indicates that a module has not been installed yet.
*/
const SCHEMA_UNINSTALLED = -1;
/**
* Returns an array of available schema versions for a module.
*
* @param string $module
* A module name.
*
* @return array|bool
* If the module has updates, an array of available updates sorted by
* version. Otherwise, FALSE.
*/
function drupal_get_schema_versions($module) {
$updates = &drupal_static(__FUNCTION__, NULL);
if (!isset($updates[$module])) {
$updates = [];
foreach (\Drupal::moduleHandler()->getModuleList() as $loaded_module => $filename) {
$updates[$loaded_module] = [];
}
// Prepare regular expression to match all possible defined hook_update_N().
$regexp = '/^(?<module>.+)_update_(?<version>\d+)$/';
$functions = get_defined_functions();
// Narrow this down to functions ending with an integer, since all
// hook_update_N() functions end this way, and there are other
// possible functions which match '_update_'. We use preg_grep() here
// instead of foreaching through all defined functions, since the loop
// through all PHP functions can take significant page execution time
// and this function is called on every administrative page via
// system_requirements().
foreach (preg_grep('/_\d+$/', $functions['user']) as $function) {
// If this function is a module update function, add it to the list of
// module updates.
if (preg_match($regexp, $function, $matches)) {
$updates[$matches['module']][] = $matches['version'];
}
}
// Ensure that updates are applied in numerical order.
foreach ($updates as &$module_updates) {
sort($module_updates, SORT_NUMERIC);
}
}
return empty($updates[$module]) ? FALSE : $updates[$module];
}
/**
* Returns the currently installed schema version for a module.
*
* @param string $module
* A module name.
* @param bool $reset
* Set to TRUE after installing or uninstalling an extension.
* @param bool $array
* Set to TRUE if you want to get information about all modules in the
* system.
*
* @return string|int
* The currently installed schema version, or SCHEMA_UNINSTALLED if the
* module is not installed.
*/
function drupal_get_installed_schema_version($module, $reset = FALSE, $array = FALSE) {
$versions = &drupal_static(__FUNCTION__, []);
if ($reset) {
$versions = [];
}
if (!$versions) {
if (!$versions = \Drupal::keyValue('system.schema')->getAll()) {
$versions = [];
}
}
if ($array) {
return $versions;
}
else {
return isset($versions[$module]) ? $versions[$module] : SCHEMA_UNINSTALLED;
}
}
/**
* Updates the installed version information for a module.
*
* @param string $module
* A module name.
* @param string $version
* The new schema version.
*/
function drupal_set_installed_schema_version($module, $version) {
\Drupal::keyValue('system.schema')->set($module, $version);
// Reset the static cache of module schema versions.
drupal_get_installed_schema_version(NULL, TRUE);
}
/**
* Creates all tables defined in a module's hook_schema().
*
* @param string $module
* The module for which the tables will be created.
*/
function drupal_install_schema($module) {
$schema = drupal_get_module_schema($module);
_drupal_schema_initialize($schema, $module, FALSE);
foreach ($schema as $name => $table) {
\Drupal::database()->schema()->createTable($name, $table);
}
}
/**
* Removes all tables defined in a module's hook_schema().
*
* @param string $module
* The module for which the tables will be removed.
*/
function drupal_uninstall_schema($module) {
$tables = drupal_get_module_schema($module);
_drupal_schema_initialize($tables, $module, FALSE);
$schema = \Drupal::database()->schema();
foreach ($tables as $table) {
if ($schema->tableExists($table['name'])) {
$schema->dropTable($table['name']);
}
}
}
/**
* Returns a module's schema.
*
* This function can be used to retrieve a schema specification in
* hook_schema(), so it allows you to derive your tables from existing
* specifications.
*
* @param string $module
* The module to which the table belongs.
* @param string $table
* The name of the table. If not given, the module's complete schema
* is returned.
*/
function drupal_get_module_schema($module, $table = NULL) {
// Load the .install file to get hook_schema.
module_load_install($module);
$schema = \Drupal::moduleHandler()->invoke($module, 'schema');
if (isset($table)) {
if (isset($schema[$table])) {
return $schema[$table];
}
return [];
}
elseif (!empty($schema)) {
return $schema;
}
return [];
}
/**
* Fills in required default values for table definitions from hook_schema().
*
* @param array $schema
* The schema definition array as it was returned by the module's
* hook_schema().
* @param string $module
* The module for which hook_schema() was invoked.
* @param bool $remove_descriptions
* (optional) Whether to additionally remove 'description' keys of all tables
* and fields to improve performance of serialize() and unserialize().
* Defaults to TRUE.
*/
function _drupal_schema_initialize(&$schema, $module, $remove_descriptions = TRUE) {
// Set the name and module key for all tables.
foreach ($schema as $name => &$table) {
if (empty($table['module'])) {
$table['module'] = $module;
}
if (!isset($table['name'])) {
$table['name'] = $name;
}
if ($remove_descriptions) {
unset($table['description']);
foreach ($table['fields'] as &$field) {
unset($field['description']);
}
}
}
}
/**
* Typecasts values to proper data types.
*
* MySQL PDO silently casts, e.g. FALSE and '' to 0, when inserting the value
* into an integer column, but PostgreSQL PDO does not. Look up the schema
* information and use that to correctly typecast the value.
*
* @param array $info
* An array describing the schema field info.
* @param mixed $value
* The value to be converted.
*
* @return mixed
* The converted value.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::castValue() instead.
*
* @see https://www.drupal.org/node/3051983
*/
function drupal_schema_get_field_value(array $info, $value) {
@trigger_error('drupal_schema_get_field_value() is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Use \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::castValue($info, $value) instead. See https://www.drupal.org/node/3051983', E_USER_DEPRECATED);
return SqlContentEntityStorageSchema::castValue($info, $value);
}
/**
* @} End of "addtogroup schemaapi".
*/
-112
View File
@@ -1,112 +0,0 @@
<?php
/**
* @file
* Functions to aid in the creation of sortable tables.
*
* All tables created when rendering a '#type' => 'table' have the option of
* having column headers that the user can click on to sort the table by that
* column.
*/
use Drupal\Core\Utility\TableSort;
/**
* Initializes the table sort context.
*
* @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Utility\TableSort::getContextFromRequest() instead.
*
* @see \Drupal\Core\Utility\TableSortInterface::getContextFromRequest()
* @see https://www.drupal.org/node/3009182
*/
function tablesort_init($header) {
@trigger_error(__FUNCTION__ . '() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Utility\TableSort::getContextFromRequest() instead. See https://www.drupal.org/node/3009182', E_USER_DEPRECATED);
return TableSort::getContextFromRequest($header, \Drupal::request());
}
/**
* Formats a column header.
*
* If the cell in question is the column header for the current sort criterion,
* it gets special formatting. All possible sort criteria become links.
*
* @param string $cell_content
* The cell content to format. Passed by reference.
* @param array $cell_attributes
* The cell attributes. Passed by reference.
* @param array $header
* An array of column headers in the format described in '#type' => 'table'.
* @param array $ts
* The current table sort context as returned from tablesort_init().
*
* @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Utility\TableSort::header() instead.
*
* @see \Drupal\Core\Utility\TableSortInterface::header()
* @see https://www.drupal.org/node/3009182
*/
function tablesort_header(&$cell_content, array &$cell_attributes, array $header, array $ts) {
@trigger_error(__FUNCTION__ . '() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Utility\TableSort::header() instead. See https://www.drupal.org/node/3009182', E_USER_DEPRECATED);
TableSort::header($cell_content, $cell_attributes, $header, $ts);
}
/**
* Composes a URL query parameter array for table sorting links.
*
* @return
* A URL query parameter array that consists of all components of the current
* page request except for those pertaining to table sorting.
*
* @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Utility\TableSort::getQueryParameters() instead.
*
* @see \Drupal\Core\Utility\TableSort::getQueryParameters()
* @see https://www.drupal.org/node/3009182
*/
function tablesort_get_query_parameters() {
@trigger_error(__FUNCTION__ . '() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Utility\TableSort::getQueryParameters() instead. See https://www.drupal.org/node/3009182', E_USER_DEPRECATED);
return TableSort::getQueryParameters(\Drupal::request());
}
/**
* Determines the current sort criterion.
*
* @param $headers
* An array of column headers in the format described in '#type' => 'table'.
*
* @return
* An associative array describing the criterion, containing the keys:
* - "name": The localized title of the table column.
* - "sql": The name of the database field to sort on.
*
* @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Utility\TableSort::getOrder() instead.
*
* @see \Drupal\Core\Utility\TableSortInterface::getOrder()
* @see https://www.drupal.org/node/3009182
*/
function tablesort_get_order($headers) {
@trigger_error(__FUNCTION__ . '() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Utility\TableSort::getOrder() instead. See https://www.drupal.org/node/3009182', E_USER_DEPRECATED);
return TableSort::getOrder($headers, \Drupal::request());
}
/**
* Determines the current sort direction.
*
* @param $headers
* An array of column headers in the format described in '#type' => 'table'.
*
* @return
* The current sort direction ("asc" or "desc").
*
* @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Utility\TableSort::getSort() instead.
*
* @see \Drupal\Core\Utility\TableSortInterface::getSort()
* @see https://www.drupal.org/node/3009182
*/
function tablesort_get_sort($headers) {
@trigger_error(__FUNCTION__ . '() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Utility\TableSort::getSort() instead. See https://www.drupal.org/node/3009182', E_USER_DEPRECATED);
return TableSort::getSort($headers, \Drupal::request());
}
File diff suppressed because it is too large Load Diff
-137
View File
@@ -1,137 +0,0 @@
<?php
/**
* @file
* Theming for maintenance pages.
*/
use Drupal\Core\Installer\InstallerKernel;
use Drupal\Core\Site\Settings;
/**
* Sets up the theming system for maintenance page.
*
* Used for site installs, updates and when the site is in maintenance mode.
* It also applies when the database is unavailable or bootstrap was not
* complete. Seven is always used for the initial install and update
* operations. In other cases, Bartik is used, but this can be overridden by
* setting a "maintenance_theme" key in the $settings variable in settings.php.
*/
function _drupal_maintenance_theme() {
// If the theme is already set, assume the others are set too, and do nothing.
if (\Drupal::theme()->hasActiveTheme()) {
return;
}
require_once __DIR__ . '/theme.inc';
require_once __DIR__ . '/common.inc';
require_once __DIR__ . '/unicode.inc';
require_once __DIR__ . '/file.inc';
require_once __DIR__ . '/module.inc';
require_once __DIR__ . '/database.inc';
// Install and update pages are treated differently to prevent theming overrides.
if (defined('MAINTENANCE_MODE') && (MAINTENANCE_MODE == 'install' || MAINTENANCE_MODE == 'update')) {
if (InstallerKernel::installationAttempted()) {
$custom_theme = $GLOBALS['install_state']['theme'];
}
else {
$custom_theme = Settings::get('maintenance_theme', 'seven');
}
}
else {
// Use the maintenance theme if specified, otherwise attempt to use the
// default site theme.
try {
$custom_theme = Settings::get('maintenance_theme', '');
if (!$custom_theme) {
$config = \Drupal::config('system.theme');
$custom_theme = $config->get('default');
}
}
catch (\Exception $e) {
// Whatever went wrong (often a database connection problem), we are
// about to fall back to a sensible theme so there is no need for special
// handling.
}
if (!$custom_theme) {
// We have been unable to identify the configured theme, so fall back to
// a safe default. Bartik is reasonably user friendly and fairly generic.
$custom_theme = 'bartik';
}
}
$themes = \Drupal::service('theme_handler')->listInfo();
// If no themes are installed yet, or if the requested custom theme is not
// installed, retrieve all available themes.
/** @var \Drupal\Core\Theme\ThemeInitialization $theme_init */
$theme_init = \Drupal::service('theme.initialization');
$theme_handler = \Drupal::service('theme_handler');
if (empty($themes) || !isset($themes[$custom_theme])) {
$themes = \Drupal::service('extension.list.theme')->getList();
$theme_handler->addTheme($themes[$custom_theme]);
}
// \Drupal\Core\Extension\ThemeHandlerInterface::listInfo() triggers a
// \Drupal\Core\Extension\ModuleHandler::alter() in maintenance mode, but we
// can't let themes alter the .info.yml data until we know a theme's base
// themes. So don't set active theme until after
// \Drupal\Core\Extension\ThemeHandlerInterface::listInfo() builds its cache.
$theme = $custom_theme;
// Find all our ancestor themes and put them in an array.
// @todo This is just a workaround. Find a better way how to handle themes
// on maintenance pages, see https://www.drupal.org/node/2322619.
// This code is basically a duplicate of
// \Drupal\Core\Theme\ThemeInitialization::getActiveThemeByName.
$base_themes = [];
$ancestor = $theme;
while ($ancestor && isset($themes[$ancestor]->base_theme)) {
$base_themes[] = $themes[$themes[$ancestor]->base_theme];
$ancestor = $themes[$ancestor]->base_theme;
if ($ancestor) {
// Ensure that the base theme is added and installed.
$theme_handler->addTheme($themes[$ancestor]);
}
}
\Drupal::theme()->setActiveTheme($theme_init->getActiveTheme($themes[$custom_theme], $base_themes));
// Prime the theme registry.
Drupal::service('theme.registry');
}
/**
* Prepares variables for authorize.php operation report templates.
*
* This report displays the results of an operation run via authorize.php.
*
* Default template: authorize-report.html.twig.
*
* @param array $variables
* An associative array containing:
* - messages: An array of result messages.
*/
function template_preprocess_authorize_report(&$variables) {
$messages = [];
if (!empty($variables['messages'])) {
foreach ($variables['messages'] as $heading => $logs) {
$items = [];
foreach ($logs as $number => $log_message) {
if ($number === '#abort') {
continue;
}
$class = 'authorize-results__' . ($log_message['success'] ? 'success' : 'failure');
$items[] = [
'#wrapper_attributes' => ['class' => [$class]],
'#markup' => $log_message['message'],
];
}
$messages[] = [
'#theme' => 'item_list',
'#items' => $items,
'#title' => $heading,
];
}
}
$variables['messages'] = $messages;
}
-126
View File
@@ -1,126 +0,0 @@
<?php
/**
* @file
* Provides Unicode-related conversions and operations.
*/
use Drupal\Component\Utility\Unicode;
/**
* Returns Unicode library status and errors.
*/
/**
* Moves unicode_requirements() logic to system_requirements().
*
* @deprecated in drupal:8.4.0 and is removed from drupal:9.0.0.
*
* @see https://www.drupal.org/node/2884698
*/
function unicode_requirements() {
@trigger_error('unicode_requirements() is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. There is no replacement; system_requirements() now includes the logic instead. See https://www.drupal.org/node/2884698', E_USER_DEPRECATED);
$libraries = [
Unicode::STATUS_SINGLEBYTE => t('Standard PHP'),
Unicode::STATUS_MULTIBYTE => t('PHP Mbstring Extension'),
Unicode::STATUS_ERROR => t('Error'),
];
$severities = [
Unicode::STATUS_SINGLEBYTE => REQUIREMENT_WARNING,
Unicode::STATUS_MULTIBYTE => NULL,
Unicode::STATUS_ERROR => REQUIREMENT_ERROR,
];
$failed_check = Unicode::check();
$library = Unicode::getStatus();
$requirements['unicode'] = [
'title' => t('Unicode library'),
'value' => $libraries[$library],
'severity' => $severities[$library],
];
switch ($failed_check) {
case 'mb_strlen':
$requirements['unicode']['description'] = t('Operations on Unicode strings are emulated on a best-effort basis. Install the <a href="http://php.net/mbstring">PHP mbstring extension</a> for improved Unicode support.');
break;
case 'mbstring.func_overload':
$requirements['unicode']['description'] = t('Multibyte string function overloading in PHP is active and must be disabled. Check the php.ini <em>mbstring.func_overload</em> setting. Please refer to the <a href="http://php.net/mbstring">PHP mbstring documentation</a> for more information.');
break;
case 'mbstring.encoding_translation':
$requirements['unicode']['description'] = t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.encoding_translation</em> setting. Please refer to the <a href="http://php.net/mbstring">PHP mbstring documentation</a> for more information.');
break;
case 'mbstring.http_input':
$requirements['unicode']['description'] = t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_input</em> setting. Please refer to the <a href="http://php.net/mbstring">PHP mbstring documentation</a> for more information.');
break;
case 'mbstring.http_output':
$requirements['unicode']['description'] = t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_output</em> setting. Please refer to the <a href="http://php.net/mbstring">PHP mbstring documentation</a> for more information.');
break;
}
return $requirements;
}
/**
* Prepares a new XML parser.
*
* This is a wrapper around xml_parser_create() which extracts the encoding
* from the XML data first and sets the output encoding to UTF-8. This function
* should be used instead of xml_parser_create(), because PHP 4's XML parser
* doesn't check the input encoding itself. "Starting from PHP 5, the input
* encoding is automatically detected, so that the encoding parameter specifies
* only the output encoding."
*
* This is also where unsupported encodings will be converted. Callers should
* take this into account: $data might have been changed after the call.
*
* @param $data
* The XML data which will be parsed later.
*
* @return
* An XML parser object or FALSE on error.
*
* @ingroup php_wrappers
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. Use
* xml_parser_create() and
* xml_parser_set_option($xml_parser, XML_OPTION_TARGET_ENCODING, 'utf-8')
* instead.
*/
function drupal_xml_parser_create(&$data) {
// Default XML encoding is UTF-8
$encoding = 'utf-8';
$bom = FALSE;
// Check for UTF-8 byte order mark (PHP5's XML parser doesn't handle it).
if (!strncmp($data, "\xEF\xBB\xBF", 3)) {
$bom = TRUE;
$data = substr($data, 3);
}
// Check for an encoding declaration in the XML prolog if no BOM was found.
if (!$bom && preg_match('/^<\?xml[^>]+encoding="(.+?)"/', $data, $match)) {
$encoding = $match[1];
}
// Unsupported encodings are converted here into UTF-8.
$php_supported = ['utf-8', 'iso-8859-1', 'us-ascii'];
if (!in_array(strtolower($encoding), $php_supported)) {
$out = Unicode::convertToUtf8($data, $encoding);
if ($out !== FALSE) {
$encoding = 'utf-8';
$data = preg_replace('/^(<\?xml[^>]+encoding)="(.+?)"/', '\\1="utf-8"', $out);
}
else {
\Drupal::logger('php')->warning('Could not convert XML encoding %s to UTF-8.', ['%s' => $encoding]);
return FALSE;
}
}
$xml_parser = xml_parser_create($encoding);
xml_parser_set_option($xml_parser, XML_OPTION_TARGET_ENCODING, 'utf-8');
return $xml_parser;
}
-786
View File
@@ -1,786 +0,0 @@
<?php
/**
* @file
* Drupal database update API.
*
* This file contains functions to perform database updates for a Drupal
* installation. It is included and used extensively by update.php.
*/
use Drupal\Component\Graph\Graph;
use Drupal\Core\Extension\Exception\UnknownExtensionException;
use Drupal\Core\Update\UpdateKernel;
use Drupal\Core\Utility\Error;
/**
* Disables any extensions that are incompatible with the current core version.
*
* @deprecated in Drupal 8.8.5 and is removed from Drupal 9.0.0.
*
* @see https://www.drupal.org/node/3026100
*/
function update_fix_compatibility() {
@trigger_error(__FUNCTION__ . '() is deprecated in Drupal 8.8.5 and will be removed before Drupal 9.0.0. There is no replacement. See https://www.drupal.org/node/3026100', E_USER_DEPRECATED);
// Fix extension objects if the update is being done via Drush 8. In non-Drush
// environments this will already be fixed by the UpdateKernel this point.
UpdateKernel::fixSerializedExtensionObjects(\Drupal::getContainer());
$extension_config = \Drupal::configFactory()->getEditable('core.extension');
$save = FALSE;
foreach (['module', 'theme'] as $type) {
foreach ($extension_config->get($type) as $name => $weight) {
if (update_check_incompatibility($name, $type)) {
$extension_config->clear("$type.$name");
$save = TRUE;
}
}
}
if ($save) {
$extension_config->set('module', module_config_sort($extension_config->get('module')));
$extension_config->save();
}
}
/**
* Tests the compatibility of a module or theme.
*/
function update_check_incompatibility($name, $type = 'module') {
static $themes, $modules;
// Store values of expensive functions for future use.
if (empty($themes) || empty($modules)) {
// We need to do a full rebuild here to make sure the database reflects any
// code changes that were made in the filesystem before the update script
// was initiated.
$themes = \Drupal::service('theme_handler')->rebuildThemeData();
$modules = \Drupal::service('extension.list.module')->reset()->getList();
}
if ($type == 'module' && isset($modules[$name])) {
$file = $modules[$name];
}
elseif ($type == 'theme' && isset($themes[$name])) {
$file = $themes[$name];
}
if (!isset($file)
|| $file->info['core_incompatible']
|| version_compare(phpversion(), $file->info['php']) < 0) {
return TRUE;
}
return FALSE;
}
/**
* Returns whether the minimum schema requirement has been satisfied.
*
* @return array
* A requirements info array.
*/
function update_system_schema_requirements() {
$requirements = [];
$system_schema = drupal_get_installed_schema_version('system');
$requirements['minimum schema']['title'] = 'Minimum schema version';
if ($system_schema >= \Drupal::CORE_MINIMUM_SCHEMA_VERSION) {
$requirements['minimum schema'] += [
'value' => 'The installed schema version meets the minimum.',
'description' => 'Schema version: ' . $system_schema,
];
}
else {
$requirements['minimum schema'] += [
'value' => 'The installed schema version does not meet the minimum.',
'severity' => REQUIREMENT_ERROR,
'description' => 'Your system schema version is ' . $system_schema . '. Updating directly from a schema version prior to 8000 is not supported. You must upgrade your site to Drupal 8 first, see https://www.drupal.org/docs/8/upgrade.',
];
}
return $requirements;
}
/**
* Checks update requirements and reports errors and (optionally) warnings.
*/
function update_check_requirements() {
// Because this is one of the earliest points in the update process,
// detect and fix missing schema versions for modules here to ensure
// it runs on all update code paths.
_update_fix_missing_schema();
// Check requirements of all loaded modules.
$requirements = \Drupal::moduleHandler()->invokeAll('requirements', ['update']);
$requirements += update_system_schema_requirements();
return $requirements;
}
/**
* Helper to detect and fix 'missing' schema information.
*
* Repairs the case where a module has no schema version recorded.
* This has to be done prior to updates being run, otherwise the update
* system would detect and attempt to run all historical updates for a
* module.
*
* @todo: remove in a major version after
* https://www.drupal.org/project/drupal/issues/3130037 has been fixed.
*/
function _update_fix_missing_schema() {
$versions = \Drupal::keyValue('system.schema')->getAll();
$module_handler = \Drupal::moduleHandler();
$enabled_modules = $module_handler->getModuleList();
foreach (array_keys($enabled_modules) as $module) {
// All modules should have a recorded schema version, but when they
// don't, detect and fix the problem.
if (!isset($versions[$module])) {
// Ensure the .install file is loaded.
module_load_install($module);
$all_updates = drupal_get_schema_versions($module);
// If the schema version of a module hasn't been recorded, we cannot
// know the actual schema version a module is at, because
// no updates will ever have been run on the site and it was not set
// correctly when the module was installed, so instead set it to
// the same as the last update. This means that updates will proceed
// again the next time the module is updated and a new update is
// added. Updates added in between the module being installed and the
// schema version being fixed here (if any have been added) will never
// be run, but we have no way to identify which updates these are.
if ($all_updates) {
$last_update = max($all_updates);
}
else {
$last_update = \Drupal::CORE_MINIMUM_SCHEMA_VERSION;
}
// If the module implements hook_update_last_removed() use the
// value of that if it's higher than the schema versions found so
// far.
if ($last_removed = $module_handler->invoke($module, 'update_last_removed')) {
$last_update = max($last_update, $last_removed);
}
drupal_set_installed_schema_version($module, $last_update);
$args = ['%module' => $module, '%last_update_hook' => $module . '_update_' . $last_update . '()'];
\Drupal::messenger()->addWarning(t('Schema information for module %module was missing from the database. You should manually review the module updates and your database to check if any updates have been skipped up to, and including, %last_update_hook.', $args));
\Drupal::logger('update')->warning('Schema information for module %module was missing from the database. You should manually review the module updates and your database to check if any updates have been skipped up to, and including, %last_update_hook.', $args);
}
}
}
/**
* Forces a module to a given schema version.
*
* This function is rarely necessary.
*
* @param string $module
* Name of the module.
* @param string $schema_version
* The schema version the module should be set to.
*/
function update_set_schema($module, $schema_version) {
\Drupal::keyValue('system.schema')->set($module, $schema_version);
\Drupal::service('extension.list.profile')->reset();
\Drupal::service('extension.list.module')->reset();
\Drupal::service('extension.list.theme_engine')->reset();
\Drupal::service('extension.list.theme')->reset();
drupal_static_reset('drupal_get_installed_schema_version');
}
/**
* Implements callback_batch_operation().
*
* Performs one update and stores the results for display on the results page.
*
* If an update function completes successfully, it should return a message
* as a string indicating success, for example:
* @code
* return t('New index added successfully.');
* @endcode
*
* Alternatively, it may return nothing. In that case, no message
* will be displayed at all.
*
* If it fails for whatever reason, it should throw an instance of
* Drupal\Core\Utility\UpdateException with an appropriate error message, for
* example:
* @code
* use Drupal\Core\Utility\UpdateException;
* throw new UpdateException('Description of what went wrong');
* @endcode
*
* If an exception is thrown, the current update and all updates that depend on
* it will be aborted. The schema version will not be updated in this case, and
* all the aborted updates will continue to appear on update.php as updates
* that have not yet been run.
*
* If an update function needs to be re-run as part of a batch process, it
* should accept the $sandbox array by reference as its first parameter
* and set the #finished property to the percentage completed that it is, as a
* fraction of 1.
*
* @param $module
* The module whose update will be run.
* @param $number
* The update number to run.
* @param $dependency_map
* An array whose keys are the names of all update functions that will be
* performed during this batch process, and whose values are arrays of other
* update functions that each one depends on.
* @param $context
* The batch context array.
*
* @see update_resolve_dependencies()
*/
function update_do_one($module, $number, $dependency_map, &$context) {
$function = $module . '_update_' . $number;
// If this update was aborted in a previous step, or has a dependency that
// was aborted in a previous step, go no further.
if (!empty($context['results']['#abort']) && array_intersect($context['results']['#abort'], array_merge($dependency_map, [$function]))) {
return;
}
$ret = [];
if (function_exists($function)) {
try {
$ret['results']['query'] = $function($context['sandbox']);
$ret['results']['success'] = TRUE;
}
// @TODO We may want to do different error handling for different
// exception types, but for now we'll just log the exception and
// return the message for printing.
// @see https://www.drupal.org/node/2564311
catch (Exception $e) {
watchdog_exception('update', $e);
$variables = Error::decodeException($e);
unset($variables['backtrace']);
$ret['#abort'] = ['success' => FALSE, 'query' => t('%type: @message in %function (line %line of %file).', $variables)];
}
}
if (isset($context['sandbox']['#finished'])) {
$context['finished'] = $context['sandbox']['#finished'];
unset($context['sandbox']['#finished']);
}
if (!isset($context['results'][$module])) {
$context['results'][$module] = [];
}
if (!isset($context['results'][$module][$number])) {
$context['results'][$module][$number] = [];
}
$context['results'][$module][$number] = array_merge($context['results'][$module][$number], $ret);
if (!empty($ret['#abort'])) {
// Record this function in the list of updates that were aborted.
$context['results']['#abort'][] = $function;
}
// Record the schema update if it was completed successfully.
if ($context['finished'] == 1 && empty($ret['#abort'])) {
drupal_set_installed_schema_version($module, $number);
}
$context['message'] = t('Updating @module', ['@module' => $module]);
}
/**
* Executes a single hook_post_update_NAME().
*
* @param string $function
* The function name, that should be executed.
* @param array $context
* The batch context array.
*/
function update_invoke_post_update($function, &$context) {
$ret = [];
// If this update was aborted in a previous step, or has a dependency that was
// aborted in a previous step, go no further.
if (!empty($context['results']['#abort'])) {
return;
}
list($module, $name) = explode('_post_update_', $function, 2);
module_load_include('php', $module, $module . '.post_update');
if (function_exists($function)) {
try {
$ret['results']['query'] = $function($context['sandbox']);
$ret['results']['success'] = TRUE;
if (!isset($context['sandbox']['#finished']) || (isset($context['sandbox']['#finished']) && $context['sandbox']['#finished'] >= 1)) {
\Drupal::service('update.post_update_registry')->registerInvokedUpdates([$function]);
}
}
// @TODO We may want to do different error handling for different exception
// types, but for now we'll just log the exception and return the message
// for printing.
// @see https://www.drupal.org/node/2564311
catch (Exception $e) {
watchdog_exception('update', $e);
$variables = Error::decodeException($e);
unset($variables['backtrace']);
$ret['#abort'] = [
'success' => FALSE,
'query' => t('%type: @message in %function (line %line of %file).', $variables),
];
}
}
if (isset($context['sandbox']['#finished'])) {
$context['finished'] = $context['sandbox']['#finished'];
unset($context['sandbox']['#finished']);
}
if (!isset($context['results'][$module][$name])) {
$context['results'][$module][$name] = [];
}
$context['results'][$module][$name] = array_merge($context['results'][$module][$name], $ret);
if (!empty($ret['#abort'])) {
// Record this function in the list of updates that were aborted.
$context['results']['#abort'][] = $function;
}
$context['message'] = t('Post updating @module', ['@module' => $module]);
}
/**
* Returns a list of all the pending database updates.
*
* @return
* An associative array keyed by module name which contains all information
* about database updates that need to be run, and any updates that are not
* going to proceed due to missing requirements. The system module will
* always be listed first.
*
* The subarray for each module can contain the following keys:
* - start: The starting update that is to be processed. If this does not
* exist then do not process any updates for this module as there are
* other requirements that need to be resolved.
* - warning: Any warnings about why this module can not be updated.
* - pending: An array of all the pending updates for the module including
* the update number and the description from source code comment for
* each update function. This array is keyed by the update number.
*/
function update_get_update_list() {
// Make sure that the system module is first in the list of updates.
$ret = ['system' => []];
$modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE);
/** @var \Drupal\Core\Extension\ExtensionList $extension_list */
$extension_list = \Drupal::service('extension.list.module');
/** @var array $installed_module_info */
$installed_module_info = $extension_list->getAllInstalledInfo();
foreach ($modules as $module => $schema_version) {
// Skip uninstalled and incompatible modules.
try {
if ($schema_version == SCHEMA_UNINSTALLED || $extension_list->checkIncompatibility($module)) {
continue;
}
}
// It is possible that the system schema has orphaned entries, so the
// incompatibility checking might throw an exception.
catch (UnknownExtensionException $e) {
$args = [
'%name' => $module,
':url' => 'https://www.drupal.org/node/3137656',
];
\Drupal::messenger()->addWarning(t('Module %name has an entry in the system.schema key/value storage, but is missing from your site. <a href=":url">More information about this error</a>.', $args));
\Drupal::logger('system')->notice('Module %name has an entry in the system.schema key/value storage, but is missing from your site. <a href=":url">More information about this error</a>.', $args);
continue;
}
// There might be orphaned entries for modules that are in the filesystem
// but not installed. Also skip those, but warn site admins about it.
if (empty($installed_module_info[$module])) {
$args = [
'%name' => $module,
':url' => 'https://www.drupal.org/node/3137656',
];
\Drupal::messenger()->addWarning(t('Module %name has an entry in the system.schema key/value storage, but is not installed. <a href=":url">More information about this error</a>.', $args));
\Drupal::logger('system')->notice('Module %name has an entry in the system.schema key/value storage, but is not installed. <a href=":url">More information about this error</a>.', $args);
continue;
}
// Display a requirements error if the user somehow has a schema version
// from the previous Drupal major version.
if ($schema_version < \Drupal::CORE_MINIMUM_SCHEMA_VERSION) {
$ret[$module]['warning'] = '<em>' . $module . '</em> module cannot be updated. Its schema version is ' . $schema_version . ', which is from an earlier major release of Drupal. You will need to <a href="https://www.drupal.org/node/2127611">migrate the data for this module</a> instead.';
continue;
}
// Otherwise, get the list of updates defined by this module.
$updates = drupal_get_schema_versions($module);
if ($updates !== FALSE) {
foreach ($updates as $update) {
if ($update == \Drupal::CORE_MINIMUM_SCHEMA_VERSION) {
$ret[$module]['warning'] = '<em>' . $module . '</em> module cannot be updated. It contains an update numbered as ' . \Drupal::CORE_MINIMUM_SCHEMA_VERSION . ' which is reserved for the earliest installation of a module in Drupal ' . \Drupal::CORE_COMPATIBILITY . ', before any updates. In order to update <em>' . $module . '</em> module, you will need to install a version of the module with valid updates.';
continue 2;
}
if ($update > $schema_version) {
// The description for an update comes from its Doxygen.
$func = new ReflectionFunction($module . '_update_' . $update);
$description = str_replace(["\n", '*', '/'], '', $func->getDocComment());
$ret[$module]['pending'][$update] = "$update - $description";
if (!isset($ret[$module]['start'])) {
$ret[$module]['start'] = $update;
}
}
}
if (!isset($ret[$module]['start']) && isset($ret[$module]['pending'])) {
$ret[$module]['start'] = $schema_version;
}
}
}
if (empty($ret['system'])) {
unset($ret['system']);
}
return $ret;
}
/**
* Resolves dependencies in a set of module updates, and orders them correctly.
*
* This function receives a list of requested module updates and determines an
* appropriate order to run them in such that all update dependencies are met.
* Any updates whose dependencies cannot be met are included in the returned
* array but have the key 'allowed' set to FALSE; the calling function should
* take responsibility for ensuring that these updates are ultimately not
* performed.
*
* In addition, the returned array also includes detailed information about the
* dependency chain for each update, as provided by the depth-first search
* algorithm in Drupal\Component\Graph\Graph::searchAndSort().
*
* @param $starting_updates
* An array whose keys contain the names of modules with updates to be run
* and whose values contain the number of the first requested update for that
* module.
*
* @return
* An array whose keys are the names of all update functions within the
* provided modules that would need to be run in order to fulfill the
* request, arranged in the order in which the update functions should be
* run. (This includes the provided starting update for each module and all
* subsequent updates that are available.) The values are themselves arrays
* containing all the keys provided by the
* Drupal\Component\Graph\Graph::searchAndSort() algorithm, which encode
* detailed information about the dependency chain for this update function
* (for example: 'paths', 'reverse_paths', 'weight', and 'component'), as
* well as the following additional keys:
* - 'allowed': A boolean which is TRUE when the update function's
* dependencies are met, and FALSE otherwise. Calling functions should
* inspect this value before running the update.
* - 'missing_dependencies': An array containing the names of any other
* update functions that are required by this one but that are unavailable
* to be run. This array will be empty when 'allowed' is TRUE.
* - 'module': The name of the module that this update function belongs to.
* - 'number': The number of this update function within that module.
*
* @see \Drupal\Component\Graph\Graph::searchAndSort()
*/
function update_resolve_dependencies($starting_updates) {
// Obtain a dependency graph for the requested update functions.
$update_functions = update_get_update_function_list($starting_updates);
$graph = update_build_dependency_graph($update_functions);
// Perform the depth-first search and sort on the results.
$graph_object = new Graph($graph);
$graph = $graph_object->searchAndSort();
uasort($graph, ['Drupal\Component\Utility\SortArray', 'sortByWeightElement']);
foreach ($graph as $function => &$data) {
$module = $data['module'];
$number = $data['number'];
// If the update function is missing and has not yet been performed, mark
// it and everything that ultimately depends on it as disallowed.
if (update_is_missing($module, $number, $update_functions) && !update_already_performed($module, $number)) {
$data['allowed'] = FALSE;
foreach (array_keys($data['paths']) as $dependent) {
$graph[$dependent]['allowed'] = FALSE;
$graph[$dependent]['missing_dependencies'][] = $function;
}
}
elseif (!isset($data['allowed'])) {
$data['allowed'] = TRUE;
$data['missing_dependencies'] = [];
}
// Now that we have finished processing this function, remove it from the
// graph if it was not part of the original list. This ensures that we
// never try to run any updates that were not specifically requested.
if (!isset($update_functions[$module][$number])) {
unset($graph[$function]);
}
}
return $graph;
}
/**
* Returns an organized list of update functions for a set of modules.
*
* @param $starting_updates
* An array whose keys contain the names of modules and whose values contain
* the number of the first requested update for that module.
*
* @return
* An array containing all the update functions that should be run for each
* module, including the provided starting update and all subsequent updates
* that are available. The keys of the array contain the module names, and
* each value is an ordered array of update functions, keyed by the update
* number.
*
* @see update_resolve_dependencies()
*/
function update_get_update_function_list($starting_updates) {
// Go through each module and find all updates that we need (including the
// first update that was requested and any updates that run after it).
$update_functions = [];
foreach ($starting_updates as $module => $version) {
$update_functions[$module] = [];
$updates = drupal_get_schema_versions($module);
if ($updates !== FALSE) {
$max_version = max($updates);
if ($version <= $max_version) {
foreach ($updates as $update) {
if ($update >= $version) {
$update_functions[$module][$update] = $module . '_update_' . $update;
}
}
}
}
}
return $update_functions;
}
/**
* Constructs a graph which encodes the dependencies between module updates.
*
* This function returns an associative array which contains a "directed graph"
* representation of the dependencies between a provided list of update
* functions, as well as any outside update functions that they directly depend
* on but that were not in the provided list. The vertices of the graph
* represent the update functions themselves, and each edge represents a
* requirement that the first update function needs to run before the second.
* For example, consider this graph:
*
* system_update_8001 ---> system_update_8002 ---> system_update_8003
*
* Visually, this indicates that system_update_8001() must run before
* system_update_8002(), which in turn must run before system_update_8003().
*
* The function takes into account standard dependencies within each module, as
* shown above (i.e., the fact that each module's updates must run in numerical
* order), but also finds any cross-module dependencies that are defined by
* modules which implement hook_update_dependencies(), and builds them into the
* graph as well.
*
* @param $update_functions
* An organized array of update functions, in the format returned by
* update_get_update_function_list().
*
* @return
* A multidimensional array representing the dependency graph, suitable for
* passing in to Drupal\Component\Graph\Graph::searchAndSort(), but with extra
* information about each update function also included. Each array key
* contains the name of an update function, including all update functions
* from the provided list as well as any outside update functions which they
* directly depend on. Each value is an associative array containing the
* following keys:
* - 'edges': A representation of any other update functions that immediately
* depend on this one. See Drupal\Component\Graph\Graph::searchAndSort() for
* more details on the format.
* - 'module': The name of the module that this update function belongs to.
* - 'number': The number of this update function within that module.
*
* @see \Drupal\Component\Graph\Graph::searchAndSort()
* @see update_resolve_dependencies()
*/
function update_build_dependency_graph($update_functions) {
// Initialize an array that will define a directed graph representing the
// dependencies between update functions.
$graph = [];
// Go through each update function and build an initial list of dependencies.
foreach ($update_functions as $module => $functions) {
$previous_function = NULL;
foreach ($functions as $number => $function) {
// Add an edge to the directed graph representing the fact that each
// update function in a given module must run after the update that
// numerically precedes it.
if ($previous_function) {
$graph[$previous_function]['edges'][$function] = TRUE;
}
$previous_function = $function;
// Define the module and update number associated with this function.
$graph[$function]['module'] = $module;
$graph[$function]['number'] = $number;
}
}
// Now add any explicit update dependencies declared by modules.
$update_dependencies = update_retrieve_dependencies();
foreach ($graph as $function => $data) {
if (!empty($update_dependencies[$data['module']][$data['number']])) {
foreach ($update_dependencies[$data['module']][$data['number']] as $module => $number) {
$dependency = $module . '_update_' . $number;
$graph[$dependency]['edges'][$function] = TRUE;
$graph[$dependency]['module'] = $module;
$graph[$dependency]['number'] = $number;
}
}
}
return $graph;
}
/**
* Determines if a module update is missing or unavailable.
*
* @param $module
* The name of the module.
* @param $number
* The number of the update within that module.
* @param $update_functions
* An organized array of update functions, in the format returned by
* update_get_update_function_list(). This should represent all module
* updates that are requested to run at the time this function is called.
*
* @return
* TRUE if the provided module update is not installed or is not in the
* provided list of updates to run; FALSE otherwise.
*/
function update_is_missing($module, $number, $update_functions) {
return !isset($update_functions[$module][$number]) || !function_exists($update_functions[$module][$number]);
}
/**
* Determines if a module update has already been performed.
*
* @param $module
* The name of the module.
* @param $number
* The number of the update within that module.
*
* @return
* TRUE if the database schema indicates that the update has already been
* performed; FALSE otherwise.
*/
function update_already_performed($module, $number) {
return $number <= drupal_get_installed_schema_version($module);
}
/**
* Invokes hook_update_dependencies() in all installed modules.
*
* This function is similar to \Drupal::moduleHandler()->invokeAll(), with the
* main difference that it does not require that a module be enabled to invoke
* its hook, only that it be installed. This allows the update system to
* properly perform updates even on modules that are currently disabled.
*
* @return
* An array of return values obtained by merging the results of the
* hook_update_dependencies() implementations in all installed modules.
*
* @see \Drupal\Core\Extension\ModuleHandlerInterface::invokeAll()
* @see hook_update_dependencies()
*/
function update_retrieve_dependencies() {
$return = [];
/** @var \Drupal\Core\Extension\ModuleExtensionList */
$extension_list = \Drupal::service('extension.list.module');
// Get a list of installed modules, arranged so that we invoke their hooks in
// the same order that \Drupal::moduleHandler()->invokeAll() does.
foreach (\Drupal::keyValue('system.schema')->getAll() as $module => $schema) {
// Skip modules that are entirely missing from the filesystem here, since
// module_load_install() will call trigger_error() if invoked on a module
// that doesn't exist. There's no way to catch() that, so avoid it entirely.
// This can happen when there are orphaned entries in the system.schema k/v
// store for modules that have been removed from a site without first being
// cleanly uninstalled. We don't care here if the module has been installed
// or not, since we'll filter those out in update_get_update_list().
if ($schema == SCHEMA_UNINSTALLED || !$extension_list->exists($module)) {
// Nothing to upgrade.
continue;
}
$function = $module . '_update_dependencies';
// Ensure install file is loaded.
module_load_install($module);
if (function_exists($function)) {
$updated_dependencies = $function();
// Each implementation of hook_update_dependencies() returns a
// multidimensional, associative array containing some keys that
// represent module names (which are strings) and other keys that
// represent update function numbers (which are integers). We cannot use
// array_merge_recursive() to properly merge these results, since it
// treats strings and integers differently. Therefore, we have to
// explicitly loop through the expected array structure here and perform
// the merge manually.
if (isset($updated_dependencies) && is_array($updated_dependencies)) {
foreach ($updated_dependencies as $module_name => $module_data) {
foreach ($module_data as $update_version => $update_data) {
foreach ($update_data as $module_dependency => $update_dependency) {
// If there are redundant dependencies declared for the same
// update function (so that it is declared to depend on more than
// one update from a particular module), record the dependency on
// the highest numbered update here, since that automatically
// implies the previous ones. For example, if one module's
// implementation of hook_update_dependencies() required this
// ordering:
//
// system_update_8002 ---> user_update_8001
//
// but another module's implementation of the hook required this
// one:
//
// system_update_8003 ---> user_update_8001
//
// we record the second one, since system_update_8002() is always
// guaranteed to run before system_update_8003() anyway (within
// an individual module, updates are always run in numerical
// order).
if (!isset($return[$module_name][$update_version][$module_dependency]) || $update_dependency > $return[$module_name][$update_version][$module_dependency]) {
$return[$module_name][$update_version][$module_dependency] = $update_dependency;
}
}
}
}
}
}
}
return $return;
}
/**
* Replace permissions during update.
*
* This function can replace one permission to several or even delete an old
* one.
*
* @param array $replace
* An associative array. The keys are the old permissions the values are lists
* of new permissions. If the list is an empty array, the old permission is
* removed.
*/
function update_replace_permissions($replace) {
$prefix = 'user.role.';
$cut = strlen($prefix);
$role_names = \Drupal::service('config.storage')->listAll($prefix);
foreach ($role_names as $role_name) {
$rid = substr($role_name, $cut);
$config = \Drupal::config("user.role.$rid");
$permissions = $config->get('permissions') ?: [];
foreach ($replace as $old_permission => $new_permissions) {
if (($index = array_search($old_permission, $permissions)) !== FALSE) {
unset($permissions[$index]);
$permissions = array_unique(array_merge($permissions, $new_permissions));
}
}
$config
->set('permissions', $permissions)
->save();
}
}
-61
View File
@@ -1,61 +0,0 @@
<?php
/**
* @file
* Miscellaneous functions.
*/
use Drupal\Core\PhpStorage\PhpStorageFactory;
use Drupal\Core\Cache\Cache;
use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;
/**
* Rebuilds all caches even when Drupal itself does not work.
*
* @param $class_loader
* The class loader. Normally Composer's ClassLoader, as included by the
* front controller, but may also be decorated; e.g.,
* \Symfony\Component\ClassLoader\ApcClassLoader, \Symfony\Component\ClassLoader\WinCacheClassLoader, or \Symfony\Component\ClassLoader\XcacheClassLoader
* @param \Symfony\Component\HttpFoundation\Request $request
* The current request.
*
* @see rebuild.php
*/
function drupal_rebuild($class_loader, Request $request) {
// Remove Drupal's error and exception handlers; they rely on a working
// service container and other subsystems and will only cause a fatal error
// that hides the actual error.
restore_error_handler();
restore_exception_handler();
// Force kernel to rebuild php cache.
PhpStorageFactory::get('twig')->deleteAll();
// Bootstrap up to where caches exist and clear them.
$kernel = new DrupalKernel('prod', $class_loader);
$kernel->setSitePath(DrupalKernel::findSitePath($request));
$kernel->boot();
$kernel->preHandle($request);
// Ensure our request includes the session if appropriate.
if (PHP_SAPI !== 'cli') {
$request->setSession($kernel->getContainer()->get('session'));
}
// Invalidate the container.
$kernel->invalidateContainer();
foreach (Cache::getBins() as $bin) {
$bin->deleteAll();
}
// Disable recording of cached pages.
\Drupal::service('page_cache_kill_switch')->trigger();
drupal_flush_all_caches();
// Restore Drupal's error and exception handlers.
// @see \Drupal\Core\DrupalKernel::boot()
set_error_handler('_drupal_error_handler');
set_exception_handler('_drupal_exception_handler');
}
-44
View File
@@ -1,44 +0,0 @@
<?php
/**
* @file
* Initiates a browser-based installation of Drupal.
*/
use Drupal\Component\Utility\OpCodeCache;
// Change the directory to the Drupal root.
chdir('..');
// Store the Drupal root path.
$root_path = realpath('');
/**
* Global flag to indicate the site is in installation mode.
*
* The constant is defined using define() instead of const so that PHP
* versions prior to 5.3 can display proper PHP requirements instead of causing
* a fatal error.
*/
define('MAINTENANCE_MODE', 'install');
// Exit early if running an incompatible PHP version to avoid fatal errors.
// The minimum version is specified explicitly, as DRUPAL_MINIMUM_PHP is not
// yet available. It is defined in bootstrap.inc, but it is not possible to
// load that file yet as it would cause a fatal error on older versions of PHP.
if (version_compare(PHP_VERSION, '7.0.8') < 0) {
print 'Your PHP installation is too old. Drupal requires at least PHP 7.0.8. See the <a href="https://www.drupal.org/requirements">system requirements</a> page for more information.';
exit;
}
// Initialize the autoloader.
$class_loader = require_once $root_path . '/autoload.php';
// If OPCache is in use, ensure opcache.save_comments is enabled.
if (OpCodeCache::isEnabled() && !ini_get('opcache.save_comments')) {
print 'Systems with OPcache installed must have <a href="http://php.net/manual/opcache.configuration.php#ini.opcache.save-comments">opcache.save_comments</a> enabled.';
exit();
}
// Start the installer.
require_once $root_path . '/core/includes/install.core.inc';
install_drupal($class_loader);
-791
View File
@@ -1,791 +0,0 @@
<?php
/**
* @file
* Contains \Drupal.
*/
use Drupal\Core\DependencyInjection\ContainerNotInitializedException;
use Drupal\Core\Messenger\LegacyMessenger;
use Drupal\Core\Url;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Static Service Container wrapper.
*
* Generally, code in Drupal should accept its dependencies via either
* constructor injection or setter method injection. However, there are cases,
* particularly in legacy procedural code, where that is infeasible. This
* class acts as a unified global accessor to arbitrary services within the
* system in order to ease the transition from procedural code to injected OO
* code.
*
* The container is built by the kernel and passed in to this class which stores
* it statically. The container always contains the services from
* \Drupal\Core\CoreServiceProvider, the service providers of enabled modules and any other
* service providers defined in $GLOBALS['conf']['container_service_providers'].
*
* This class exists only to support legacy code that cannot be dependency
* injected. If your code needs it, consider refactoring it to be object
* oriented, if possible. When this is not possible, for instance in the case of
* hook implementations, and your code is more than a few non-reusable lines, it
* is recommended to instantiate an object implementing the actual logic.
*
* @code
* // Legacy procedural code.
* function hook_do_stuff() {
* $lock = lock()->acquire('stuff_lock');
* // ...
* }
*
* // Correct procedural code.
* function hook_do_stuff() {
* $lock = \Drupal::lock()->acquire('stuff_lock');
* // ...
* }
*
* // The preferred way: dependency injected code.
* function hook_do_stuff() {
* // Move the actual implementation to a class and instantiate it.
* $instance = new StuffDoingClass(\Drupal::lock());
* $instance->doStuff();
*
* // Or, even better, rely on the service container to avoid hard coding a
* // specific interface implementation, so that the actual logic can be
* // swapped. This might not always make sense, but in general it is a good
* // practice.
* \Drupal::service('stuff.doing')->doStuff();
* }
*
* interface StuffDoingInterface {
* public function doStuff();
* }
*
* class StuffDoingClass implements StuffDoingInterface {
* protected $lockBackend;
*
* public function __construct(LockBackendInterface $lock_backend) {
* $this->lockBackend = $lock_backend;
* }
*
* public function doStuff() {
* $lock = $this->lockBackend->acquire('stuff_lock');
* // ...
* }
* }
* @endcode
*
* @see \Drupal\Core\DrupalKernel
*/
class Drupal {
/**
* The current system version.
*/
const VERSION = '8.9.7';
/**
* Core API compatibility.
*/
const CORE_COMPATIBILITY = '8.x';
/**
* Core minimum schema version.
*/
const CORE_MINIMUM_SCHEMA_VERSION = 8000;
/**
* The currently active container object, or NULL if not initialized yet.
*
* @var \Symfony\Component\DependencyInjection\ContainerInterface|null
*/
protected static $container;
/**
* Sets a new global container.
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* A new container instance to replace the current.
*/
public static function setContainer(ContainerInterface $container) {
static::$container = $container;
}
/**
* Unsets the global container.
*/
public static function unsetContainer() {
static::$container = NULL;
}
/**
* Returns the currently active global container.
*
* @return \Symfony\Component\DependencyInjection\ContainerInterface
*
* @throws \Drupal\Core\DependencyInjection\ContainerNotInitializedException
*/
public static function getContainer() {
if (static::$container === NULL) {
throw new ContainerNotInitializedException('\Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container.');
}
return static::$container;
}
/**
* Returns TRUE if the container has been initialized, FALSE otherwise.
*
* @return bool
*/
public static function hasContainer() {
return static::$container !== NULL;
}
/**
* Retrieves a service from the container.
*
* Use this method if the desired service is not one of those with a dedicated
* accessor method below. If it is listed below, those methods are preferred
* as they can return useful type hints.
*
* @param string $id
* The ID of the service to retrieve.
*
* @return mixed
* The specified service.
*/
public static function service($id) {
return static::getContainer()->get($id);
}
/**
* Indicates if a service is defined in the container.
*
* @param string $id
* The ID of the service to check.
*
* @return bool
* TRUE if the specified service exists, FALSE otherwise.
*/
public static function hasService($id) {
// Check hasContainer() first in order to always return a Boolean.
return static::hasContainer() && static::getContainer()->has($id);
}
/**
* Gets the app root.
*
* @return string
*/
public static function root() {
return static::getContainer()->get('app.root');
}
/**
* Gets the active install profile.
*
* @return string|null
* The name of the active install profile.
*/
public static function installProfile() {
return static::getContainer()->getParameter('install_profile');
}
/**
* Indicates if there is a currently active request object.
*
* @return bool
* TRUE if there is a currently active request object, FALSE otherwise.
*/
public static function hasRequest() {
// Check hasContainer() first in order to always return a Boolean.
return static::hasContainer() && static::getContainer()->has('request_stack') && static::getContainer()->get('request_stack')->getCurrentRequest() !== NULL;
}
/**
* Retrieves the currently active request object.
*
* Note: The use of this wrapper in particular is especially discouraged. Most
* code should not need to access the request directly. Doing so means it
* will only function when handling an HTTP request, and will require special
* modification or wrapping when run from a command line tool, from certain
* queue processors, or from automated tests.
*
* If code must access the request, it is considerably better to register
* an object with the Service Container and give it a setRequest() method
* that is configured to run when the service is created. That way, the
* correct request object can always be provided by the container and the
* service can still be unit tested.
*
* If this method must be used, never save the request object that is
* returned. Doing so may lead to inconsistencies as the request object is
* volatile and may change at various times, such as during a subrequest.
*
* @return \Symfony\Component\HttpFoundation\Request
* The currently active request object.
*/
public static function request() {
return static::getContainer()->get('request_stack')->getCurrentRequest();
}
/**
* Retrieves the request stack.
*
* @return \Symfony\Component\HttpFoundation\RequestStack
* The request stack
*/
public static function requestStack() {
return static::getContainer()->get('request_stack');
}
/**
* Retrieves the currently active route match object.
*
* @return \Drupal\Core\Routing\RouteMatchInterface
* The currently active route match object.
*/
public static function routeMatch() {
return static::getContainer()->get('current_route_match');
}
/**
* Gets the current active user.
*
* This method will return the \Drupal\Core\Session\AccountProxy object of the
* current user. You can use the \Drupal\user\Entity\User::load() method to
* load the full user entity object. For example:
* @code
* $user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
* @endcode
*
* @return \Drupal\Core\Session\AccountProxyInterface
*/
public static function currentUser() {
return static::getContainer()->get('current_user');
}
/**
* Retrieves the entity manager service.
*
* @return \Drupal\Core\Entity\EntityManagerInterface
* The entity manager service.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
* Use \Drupal::entityTypeManager() instead in most cases. If the needed
* method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the
* deprecated \Drupal\Core\Entity\EntityManager to find the
* correct interface or service.
*/
public static function entityManager() {
@trigger_error("\Drupal::entityManager() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager() instead in most cases. If the needed method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the deprecated \Drupal\Core\Entity\EntityManager to find the correct interface or service. See https://www.drupal.org/node/2549139", E_USER_DEPRECATED);
return static::getContainer()->get('entity.manager');
}
/**
* Retrieves the entity type manager.
*
* @return \Drupal\Core\Entity\EntityTypeManagerInterface
* The entity type manager.
*/
public static function entityTypeManager() {
return static::getContainer()->get('entity_type.manager');
}
/**
* Returns the current primary database.
*
* @return \Drupal\Core\Database\Connection
* The current active database's master connection.
*/
public static function database() {
return static::getContainer()->get('database');
}
/**
* Returns the requested cache bin.
*
* @param string $bin
* (optional) The cache bin for which the cache object should be returned,
* defaults to 'default'.
*
* @return \Drupal\Core\Cache\CacheBackendInterface
* The cache object associated with the specified bin.
*
* @ingroup cache
*/
public static function cache($bin = 'default') {
return static::getContainer()->get('cache.' . $bin);
}
/**
* Retrieves the class resolver.
*
* This is to be used in procedural code such as module files to instantiate
* an object of a class that implements
* \Drupal\Core\DependencyInjection\ContainerInjectionInterface.
*
* One common usecase is to provide a class which contains the actual code
* of a hook implementation, without having to create a service.
*
* @param string $class
* (optional) A class name to instantiate.
*
* @return \Drupal\Core\DependencyInjection\ClassResolverInterface|object
* The class resolver or if $class is provided, a class instance with a
* given class definition.
*
* @throws \InvalidArgumentException
* If $class does not exist.
*/
public static function classResolver($class = NULL) {
if ($class) {
return static::getContainer()->get('class_resolver')->getInstanceFromDefinition($class);
}
return static::getContainer()->get('class_resolver');
}
/**
* Returns an expirable key value store collection.
*
* @param string $collection
* The name of the collection holding key and value pairs.
*
* @return \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface
* An expirable key value store collection.
*/
public static function keyValueExpirable($collection) {
return static::getContainer()->get('keyvalue.expirable')->get($collection);
}
/**
* Returns the locking layer instance.
*
* @return \Drupal\Core\Lock\LockBackendInterface
*
* @ingroup lock
*/
public static function lock() {
return static::getContainer()->get('lock');
}
/**
* Retrieves a configuration object.
*
* This is the main entry point to the configuration API. Calling
* @code \Drupal::config('book.admin') @endcode will return a configuration
* object the Book module can use to read its administrative settings.
*
* @param string $name
* The name of the configuration object to retrieve, which typically
* corresponds to a configuration file. For
* @code \Drupal::config('book.admin') @endcode, the configuration
* object returned will contain the content of the book.admin
* configuration file.
*
* @return \Drupal\Core\Config\ImmutableConfig
* An immutable configuration object.
*/
public static function config($name) {
return static::getContainer()->get('config.factory')->get($name);
}
/**
* Retrieves the configuration factory.
*
* This is mostly used to change the override settings on the configuration
* factory. For example, changing the language, or turning all overrides on
* or off.
*
* @return \Drupal\Core\Config\ConfigFactoryInterface
* The configuration factory service.
*/
public static function configFactory() {
return static::getContainer()->get('config.factory');
}
/**
* Returns a queue for the given queue name.
*
* The following values can be set in your settings.php file's $settings
* array to define which services are used for queues:
* - queue_reliable_service_$name: The container service to use for the
* reliable queue $name.
* - queue_service_$name: The container service to use for the
* queue $name.
* - queue_default: The container service to use by default for queues
* without overrides. This defaults to 'queue.database'.
*
* @param string $name
* The name of the queue to work with.
* @param bool $reliable
* (optional) TRUE if the ordering of items and guaranteeing every item
* executes at least once is important, FALSE if scalability is the main
* concern. Defaults to FALSE.
*
* @return \Drupal\Core\Queue\QueueInterface
* The queue object for a given name.
*/
public static function queue($name, $reliable = FALSE) {
return static::getContainer()->get('queue')->get($name, $reliable);
}
/**
* Returns a key/value storage collection.
*
* @param string $collection
* Name of the key/value collection to return.
*
* @return \Drupal\Core\KeyValueStore\KeyValueStoreInterface
*/
public static function keyValue($collection) {
return static::getContainer()->get('keyvalue')->get($collection);
}
/**
* Returns the state storage service.
*
* Use this to store machine-generated data, local to a specific environment
* that does not need deploying and does not need human editing; for example,
* the last time cron was run. Data which needs to be edited by humans and
* needs to be the same across development, production, etc. environments
* (for example, the system maintenance message) should use \Drupal::config() instead.
*
* @return \Drupal\Core\State\StateInterface
*/
public static function state() {
return static::getContainer()->get('state');
}
/**
* Returns the default http client.
*
* @return \GuzzleHttp\Client
* A guzzle http client instance.
*/
public static function httpClient() {
return static::getContainer()->get('http_client');
}
/**
* Returns the entity query object for this entity type.
*
* @param string $entity_type
* The entity type (for example, node) for which the query object should be
* returned.
* @param string $conjunction
* (optional) Either 'AND' if all conditions in the query need to apply, or
* 'OR' if any of them is sufficient. Defaults to 'AND'.
*
* @return \Drupal\Core\Entity\Query\QueryInterface
* The query object that can query the given entity type.
*/
public static function entityQuery($entity_type, $conjunction = 'AND') {
return static::entityTypeManager()->getStorage($entity_type)->getQuery($conjunction);
}
/**
* Returns the entity query aggregate object for this entity type.
*
* @param string $entity_type
* The entity type (for example, node) for which the query object should be
* returned.
* @param string $conjunction
* (optional) Either 'AND' if all conditions in the query need to apply, or
* 'OR' if any of them is sufficient. Defaults to 'AND'.
*
* @return \Drupal\Core\Entity\Query\QueryAggregateInterface
* The query object that can query the given entity type.
*/
public static function entityQueryAggregate($entity_type, $conjunction = 'AND') {
return static::entityTypeManager()->getStorage($entity_type)->getAggregateQuery($conjunction);
}
/**
* Returns the flood instance.
*
* @return \Drupal\Core\Flood\FloodInterface
*/
public static function flood() {
return static::getContainer()->get('flood');
}
/**
* Returns the module handler.
*
* @return \Drupal\Core\Extension\ModuleHandlerInterface
*/
public static function moduleHandler() {
return static::getContainer()->get('module_handler');
}
/**
* Returns the typed data manager service.
*
* Use the typed data manager service for creating typed data objects.
*
* @return \Drupal\Core\TypedData\TypedDataManagerInterface
* The typed data manager.
*
* @see \Drupal\Core\TypedData\TypedDataManager::create()
*/
public static function typedDataManager() {
return static::getContainer()->get('typed_data_manager');
}
/**
* Returns the token service.
*
* @return \Drupal\Core\Utility\Token
* The token service.
*/
public static function token() {
return static::getContainer()->get('token');
}
/**
* Returns the url generator service.
*
* @return \Drupal\Core\Routing\UrlGeneratorInterface
* The url generator service.
*/
public static function urlGenerator() {
return static::getContainer()->get('url_generator');
}
/**
* Generates a URL string for a specific route based on the given parameters.
*
* This method is a convenience wrapper for generating URL strings for URLs
* that have Drupal routes (that is, most pages generated by Drupal) using
* the \Drupal\Core\Url object. See \Drupal\Core\Url::fromRoute() for
* detailed documentation. For non-routed local URIs relative to
* the base path (like robots.txt) use Url::fromUri()->toString() with the
* base: scheme.
*
* @param string $route_name
* The name of the route.
* @param array $route_parameters
* (optional) An associative array of parameter names and values.
* @param array $options
* (optional) An associative array of additional options.
* @param bool $collect_bubbleable_metadata
* (optional) Defaults to FALSE. When TRUE, both the generated URL and its
* associated bubbleable metadata are returned.
*
* @return string|\Drupal\Core\GeneratedUrl
* A string containing a URL to the given path.
* When $collect_bubbleable_metadata is TRUE, a GeneratedUrl object is
* returned, containing the generated URL plus bubbleable metadata.
*
* @see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute()
* @see \Drupal\Core\Url
* @see \Drupal\Core\Url::fromRoute()
* @see \Drupal\Core\Url::fromUri()
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
* Instead create a \Drupal\Core\Url object directly, for example using
* Url::fromRoute().
*/
public static function url($route_name, $route_parameters = [], $options = [], $collect_bubbleable_metadata = FALSE) {
@trigger_error('Drupal::url() is deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Instead create a \Drupal\Core\Url object directly, for example using Url::fromRoute()', E_USER_DEPRECATED);
return static::getContainer()->get('url_generator')->generateFromRoute($route_name, $route_parameters, $options, $collect_bubbleable_metadata);
}
/**
* Returns the link generator service.
*
* @return \Drupal\Core\Utility\LinkGeneratorInterface
*/
public static function linkGenerator() {
return static::getContainer()->get('link_generator');
}
/**
* Renders a link with a given link text and Url object.
*
* This method is a convenience wrapper for the link generator service's
* generate() method.
*
* @param string|array|\Drupal\Component\Render\MarkupInterface $text
* The link text for the anchor tag as a translated string or render array.
* @param \Drupal\Core\Url $url
* The URL object used for the link.
*
* @return \Drupal\Core\GeneratedLink
* A GeneratedLink object containing a link to the given route and
* parameters and bubbleable metadata.
*
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Link::fromTextAndUrl() instead.
*
* @see https://www.drupal.org/node/2614344
* @see \Drupal\Core\Utility\LinkGeneratorInterface::generate()
* @see \Drupal\Core\Url
*/
public static function l($text, Url $url) {
@trigger_error('\Drupal::l() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Link::fromTextAndUrl() instead. See https://www.drupal.org/node/2614344', E_USER_DEPRECATED);
return static::getContainer()->get('link_generator')->generate($text, $url);
}
/**
* Returns the string translation service.
*
* @return \Drupal\Core\StringTranslation\TranslationManager
* The string translation manager.
*/
public static function translation() {
return static::getContainer()->get('string_translation');
}
/**
* Returns the language manager service.
*
* @return \Drupal\Core\Language\LanguageManagerInterface
* The language manager.
*/
public static function languageManager() {
return static::getContainer()->get('language_manager');
}
/**
* Returns the CSRF token manager service.
*
* The generated token is based on the session ID of the current user. Normally,
* anonymous users do not have a session, so the generated token will be
* different on every page request. To generate a token for users without a
* session, manually start a session prior to calling this function.
*
* @return \Drupal\Core\Access\CsrfTokenGenerator
* The CSRF token manager.
*
* @see \Drupal\Core\Session\SessionManager::start()
*/
public static function csrfToken() {
return static::getContainer()->get('csrf_token');
}
/**
* Returns the transliteration service.
*
* @return \Drupal\Core\Transliteration\PhpTransliteration
* The transliteration manager.
*/
public static function transliteration() {
return static::getContainer()->get('transliteration');
}
/**
* Returns the form builder service.
*
* @return \Drupal\Core\Form\FormBuilderInterface
* The form builder.
*/
public static function formBuilder() {
return static::getContainer()->get('form_builder');
}
/**
* Gets the theme service.
*
* @return \Drupal\Core\Theme\ThemeManagerInterface
*/
public static function theme() {
return static::getContainer()->get('theme.manager');
}
/**
* Gets the syncing state.
*
* @return bool
* Returns TRUE is syncing flag set.
*/
public static function isConfigSyncing() {
return static::getContainer()->get('config.installer')->isSyncing();
}
/**
* Returns a channel logger object.
*
* @param string $channel
* The name of the channel. Can be any string, but the general practice is
* to use the name of the subsystem calling this.
*
* @return \Psr\Log\LoggerInterface
* The logger for this channel.
*/
public static function logger($channel) {
return static::getContainer()->get('logger.factory')->get($channel);
}
/**
* Returns the menu tree.
*
* @return \Drupal\Core\Menu\MenuLinkTreeInterface
* The menu tree.
*/
public static function menuTree() {
return static::getContainer()->get('menu.link_tree');
}
/**
* Returns the path validator.
*
* @return \Drupal\Core\Path\PathValidatorInterface
*/
public static function pathValidator() {
return static::getContainer()->get('path.validator');
}
/**
* Returns the access manager service.
*
* @return \Drupal\Core\Access\AccessManagerInterface
* The access manager service.
*/
public static function accessManager() {
return static::getContainer()->get('access_manager');
}
/**
* Returns the redirect destination helper.
*
* @return \Drupal\Core\Routing\RedirectDestinationInterface
* The redirect destination helper.
*/
public static function destination() {
return static::getContainer()->get('redirect.destination');
}
/**
* Returns the entity definition update manager.
*
* @return \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface
* The entity definition update manager.
*/
public static function entityDefinitionUpdateManager() {
return static::getContainer()->get('entity.definition_update_manager');
}
/**
* Returns the time service.
*
* @return \Drupal\Component\Datetime\TimeInterface
* The time service.
*/
public static function time() {
return static::getContainer()->get('datetime.time');
}
/**
* Returns the messenger.
*
* @return \Drupal\Core\Messenger\MessengerInterface
* The messenger.
*/
public static function messenger() {
// @todo Replace with service once LegacyMessenger is removed in 9.0.0.
// @see https://www.drupal.org/node/2928994
return new LegacyMessenger();
}
}
@@ -1,66 +0,0 @@
<?php
namespace Drupal\Component\Annotation;
/**
* Provides a base class for classed annotations.
*/
abstract class AnnotationBase implements AnnotationInterface {
/**
* The annotated class ID.
*
* @var string
*/
public $id;
/**
* The class used for this annotated class.
*
* @var string
*/
protected $class;
/**
* The provider of the annotated class.
*
* @var string
*/
protected $provider;
/**
* {@inheritdoc}
*/
public function getProvider() {
return $this->provider;
}
/**
* {@inheritdoc}
*/
public function setProvider($provider) {
$this->provider = $provider;
}
/**
* {@inheritdoc}
*/
public function getId() {
return $this->id;
}
/**
* {@inheritdoc}
*/
public function getClass() {
return $this->class;
}
/**
* {@inheritdoc}
*/
public function setClass($class) {
$this->class = $class;
}
}
@@ -1,50 +0,0 @@
<?php
namespace Drupal\Component\Annotation;
/**
* Defines a common interface for classed annotations.
*/
interface AnnotationInterface {
/**
* Gets the value of an annotation.
*/
public function get();
/**
* Gets the name of the provider of the annotated class.
*
* @return string
*/
public function getProvider();
/**
* Sets the name of the provider of the annotated class.
*
* @param string $provider
*/
public function setProvider($provider);
/**
* Gets the unique ID for this annotated class.
*
* @return string
*/
public function getId();
/**
* Gets the class of the annotated class.
*
* @return string
*/
public function getClass();
/**
* Sets the class of the annotated class.
*
* @param string $class
*/
public function setClass($class);
}
File diff suppressed because it is too large Load Diff
@@ -1,161 +0,0 @@
<?php
// @codingStandardsIgnoreFile
/**
* @file
*
* This class is a near-copy of
* Doctrine\Common\Annotations\SimpleAnnotationReader, which is part of the
* Doctrine project: <http://www.doctrine-project.org>. It was copied from
* version 1.2.7.
*
* Original copyright:
*
* Copyright (c) 2006-2013 Doctrine Project
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*/
namespace Drupal\Component\Annotation\Doctrine;
use Doctrine\Common\Annotations\Reader;
/**
* Simple Annotation Reader.
*
* Drupal adds its own version of DocParser and allows for ignoring common
* annotations.
*
* @internal
*/
final class SimpleAnnotationReader implements Reader
{
protected $ignoredAnnotations = [
'addtogroup' => TRUE,
'code' => TRUE,
'defgroup' => TRUE,
'deprecated' => TRUE,
'endcode' => TRUE,
'endlink' => TRUE,
'file' => TRUE,
'ingroup' => TRUE,
'group' => TRUE,
'link' => TRUE,
'mainpage' => TRUE,
'param' => TRUE,
'ref' => TRUE,
'return' => TRUE,
'section' => TRUE,
'see' => TRUE,
'subsection' => TRUE,
'throws' => TRUE,
'todo' => TRUE,
'var' => TRUE,
'{' => TRUE,
'}' => TRUE,
];
/**
* @var DocParser
*/
private $parser;
/**
* Constructor.
*
* Initializes a new SimpleAnnotationReader.
*/
public function __construct()
{
$this->parser = new DocParser();
$this->parser->setIgnoreNotImportedAnnotations(true);
$this->parser->setIgnoredAnnotationNames($this->ignoredAnnotations);
}
/**
* Adds a namespace in which we will look for annotations.
*
* @param string $namespace
*
* @return void
*/
public function addNamespace($namespace)
{
$this->parser->addNamespace($namespace);
}
/**
* {@inheritDoc}
*/
public function getClassAnnotations(\ReflectionClass $class)
{
return $this->parser->parse($class->getDocComment(), 'class '.$class->getName());
}
/**
* {@inheritDoc}
*/
public function getMethodAnnotations(\ReflectionMethod $method)
{
return $this->parser->parse($method->getDocComment(), 'method '.$method->getDeclaringClass()->name.'::'.$method->getName().'()');
}
/**
* {@inheritDoc}
*/
public function getPropertyAnnotations(\ReflectionProperty $property)
{
return $this->parser->parse($property->getDocComment(), 'property '.$property->getDeclaringClass()->name.'::$'.$property->getName());
}
/**
* {@inheritDoc}
*/
public function getClassAnnotation(\ReflectionClass $class, $annotationName)
{
foreach ($this->getClassAnnotations($class) as $annot) {
if ($annot instanceof $annotationName) {
return $annot;
}
}
return null;
}
/**
* {@inheritDoc}
*/
public function getMethodAnnotation(\ReflectionMethod $method, $annotationName)
{
foreach ($this->getMethodAnnotations($method) as $annot) {
if ($annot instanceof $annotationName) {
return $annot;
}
}
return null;
}
/**
* {@inheritDoc}
*/
public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName)
{
foreach ($this->getPropertyAnnotations($property) as $annot) {
if ($annot instanceof $annotationName) {
return $annot;
}
}
return null;
}
}
@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
@@ -1,112 +0,0 @@
<?php
namespace Drupal\Component\Annotation;
use Drupal\Component\Utility\NestedArray;
/**
* Defines a Plugin annotation object.
*
* Annotations in plugin classes can use this class in order to pass various
* metadata about the plugin through the parser to
* DiscoveryInterface::getDefinitions() calls. This allows the metadata
* of a class to be located with the class itself, rather than in module-based
* info hooks.
*
* @ingroup plugin_api
*
* @Annotation
*/
class Plugin implements AnnotationInterface {
/**
* The plugin definition read from the class annotation.
*
* @var array
*/
protected $definition;
/**
* Constructs a Plugin object.
*
* Builds up the plugin definition and invokes the get() method for any
* classed annotations that were used.
*/
public function __construct($values) {
$reflection = new \ReflectionClass($this);
// Only keep actual default values by ignoring NULL values.
$defaults = array_filter($reflection->getDefaultProperties(), function ($value) {
return $value !== NULL;
});
$parsed_values = $this->parse($values);
$this->definition = NestedArray::mergeDeepArray([$defaults, $parsed_values], TRUE);
}
/**
* Parses an annotation into its definition.
*
* @param array $values
* The annotation array.
*
* @return array
* The parsed annotation as a definition.
*/
protected function parse(array $values) {
$definitions = [];
foreach ($values as $key => $value) {
if ($value instanceof AnnotationInterface) {
$definitions[$key] = $value->get();
}
elseif (is_array($value)) {
$definitions[$key] = $this->parse($value);
}
else {
$definitions[$key] = $value;
}
}
return $definitions;
}
/**
* {@inheritdoc}
*/
public function get() {
return $this->definition;
}
/**
* {@inheritdoc}
*/
public function getProvider() {
return isset($this->definition['provider']) ? $this->definition['provider'] : FALSE;
}
/**
* {@inheritdoc}
*/
public function setProvider($provider) {
$this->definition['provider'] = $provider;
}
/**
* {@inheritdoc}
*/
public function getId() {
return $this->definition['id'];
}
/**
* {@inheritdoc}
*/
public function getClass() {
return $this->definition['class'];
}
/**
* {@inheritdoc}
*/
public function setClass($class) {
$this->definition['class'] = $class;
}
}
@@ -1,191 +0,0 @@
<?php
namespace Drupal\Component\Annotation\Plugin\Discovery;
use Drupal\Component\Annotation\AnnotationInterface;
use Drupal\Component\FileCache\FileCacheFactory;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\Component\Annotation\Doctrine\SimpleAnnotationReader;
use Drupal\Component\Annotation\Reflection\MockFileFinder;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Reflection\StaticReflectionParser;
use Drupal\Component\Plugin\Discovery\DiscoveryTrait;
use Drupal\Component\Utility\Crypt;
/**
* Defines a discovery mechanism to find annotated plugins in PSR-4 namespaces.
*/
class AnnotatedClassDiscovery implements DiscoveryInterface {
use DiscoveryTrait;
/**
* The namespaces within which to find plugin classes.
*
* @var string[]
*/
protected $pluginNamespaces;
/**
* The name of the annotation that contains the plugin definition.
*
* The class corresponding to this name must implement
* \Drupal\Component\Annotation\AnnotationInterface.
*
* @var string
*/
protected $pluginDefinitionAnnotationName;
/**
* The doctrine annotation reader.
*
* @var \Doctrine\Common\Annotations\Reader
*/
protected $annotationReader;
/**
* Additional namespaces to be scanned for annotation classes.
*
* @var string[]
*/
protected $annotationNamespaces = [];
/**
* The file cache object.
*
* @var \Drupal\Component\FileCache\FileCacheInterface
*/
protected $fileCache;
/**
* Constructs a new instance.
*
* @param string[] $plugin_namespaces
* (optional) An array of namespace that may contain plugin implementations.
* Defaults to an empty array.
* @param string $plugin_definition_annotation_name
* (optional) The name of the annotation that contains the plugin definition.
* Defaults to 'Drupal\Component\Annotation\Plugin'.
* @param string[] $annotation_namespaces
* (optional) Additional namespaces to be scanned for annotation classes.
*/
public function __construct($plugin_namespaces = [], $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin', array $annotation_namespaces = []) {
$this->pluginNamespaces = $plugin_namespaces;
$this->pluginDefinitionAnnotationName = $plugin_definition_annotation_name;
$this->annotationNamespaces = $annotation_namespaces;
$file_cache_suffix = str_replace('\\', '_', $plugin_definition_annotation_name);
$file_cache_suffix .= ':' . Crypt::hashBase64(serialize($annotation_namespaces));
$this->fileCache = FileCacheFactory::get('annotation_discovery:' . $file_cache_suffix);
}
/**
* Gets the used doctrine annotation reader.
*
* @return \Doctrine\Common\Annotations\Reader
* The annotation reader.
*/
protected function getAnnotationReader() {
if (!isset($this->annotationReader)) {
$this->annotationReader = new SimpleAnnotationReader();
// Add the namespaces from the main plugin annotation, like @EntityType.
$namespace = substr($this->pluginDefinitionAnnotationName, 0, strrpos($this->pluginDefinitionAnnotationName, '\\'));
$this->annotationReader->addNamespace($namespace);
// Register additional namespaces to be scanned for annotations.
foreach ($this->annotationNamespaces as $namespace) {
$this->annotationReader->addNamespace($namespace);
}
}
return $this->annotationReader;
}
/**
* {@inheritdoc}
*/
public function getDefinitions() {
$definitions = [];
$reader = $this->getAnnotationReader();
// Clear the annotation loaders of any previous annotation classes.
AnnotationRegistry::reset();
// Register the namespaces of classes that can be used for annotations.
AnnotationRegistry::registerLoader('class_exists');
// Search for classes within all PSR-4 namespace locations.
foreach ($this->getPluginNamespaces() as $namespace => $dirs) {
foreach ($dirs as $dir) {
if (file_exists($dir)) {
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS)
);
foreach ($iterator as $fileinfo) {
if ($fileinfo->getExtension() == 'php') {
if ($cached = $this->fileCache->get($fileinfo->getPathName())) {
if (isset($cached['id'])) {
// Explicitly unserialize this to create a new object instance.
$definitions[$cached['id']] = unserialize($cached['content']);
}
continue;
}
$sub_path = $iterator->getSubIterator()->getSubPath();
$sub_path = $sub_path ? str_replace(DIRECTORY_SEPARATOR, '\\', $sub_path) . '\\' : '';
$class = $namespace . '\\' . $sub_path . $fileinfo->getBasename('.php');
// The filename is already known, so there is no need to find the
// file. However, StaticReflectionParser needs a finder, so use a
// mock version.
$finder = MockFileFinder::create($fileinfo->getPathName());
$parser = new StaticReflectionParser($class, $finder, TRUE);
/** @var $annotation \Drupal\Component\Annotation\AnnotationInterface */
if ($annotation = $reader->getClassAnnotation($parser->getReflectionClass(), $this->pluginDefinitionAnnotationName)) {
$this->prepareAnnotationDefinition($annotation, $class);
$id = $annotation->getId();
$content = $annotation->get();
$definitions[$id] = $content;
// Explicitly serialize this to create a new object instance.
$this->fileCache->set($fileinfo->getPathName(), ['id' => $id, 'content' => serialize($content)]);
}
else {
// Store a NULL object, so the file is not reparsed again.
$this->fileCache->set($fileinfo->getPathName(), [NULL]);
}
}
}
}
}
}
// Don't let annotation loaders pile up.
AnnotationRegistry::reset();
return $definitions;
}
/**
* Prepares the annotation definition.
*
* @param \Drupal\Component\Annotation\AnnotationInterface $annotation
* The annotation derived from the plugin.
* @param string $class
* The class used for the plugin.
*/
protected function prepareAnnotationDefinition(AnnotationInterface $annotation, $class) {
$annotation->setClass($class);
}
/**
* Gets an array of PSR-4 namespaces to search for plugin classes.
*
* @return string[]
*/
protected function getPluginNamespaces() {
return $this->pluginNamespaces;
}
}
@@ -1,75 +0,0 @@
<?php
namespace Drupal\Component\Annotation\Plugin\Discovery;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\Component\Plugin\Discovery\DiscoveryTrait;
/**
* Ensures that all definitions are run through the annotation process.
*/
class AnnotationBridgeDecorator implements DiscoveryInterface {
use DiscoveryTrait;
/**
* The decorated plugin discovery.
*
* @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface
*/
protected $decorated;
/**
* The name of the annotation that contains the plugin definition.
*
* @var string|null
*/
protected $pluginDefinitionAnnotationName;
/**
* ObjectDefinitionDiscoveryDecorator constructor.
*
* @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface $decorated
* The discovery object that is being decorated.
* @param string $plugin_definition_annotation_name
* The name of the annotation that contains the plugin definition. The class
* corresponding to this name must implement
* \Drupal\Component\Annotation\AnnotationInterface.
*/
public function __construct(DiscoveryInterface $decorated, $plugin_definition_annotation_name) {
$this->decorated = $decorated;
$this->pluginDefinitionAnnotationName = $plugin_definition_annotation_name;
}
/**
* {@inheritdoc}
*/
public function getDefinitions() {
$definitions = $this->decorated->getDefinitions();
foreach ($definitions as $id => $definition) {
// Annotation constructors expect an array of values. If the definition is
// not an array, it usually means it has been processed already and can be
// ignored.
if (is_array($definition)) {
$definitions[$id] = (new $this->pluginDefinitionAnnotationName($definition))->get();
}
}
return $definitions;
}
/**
* Passes through all unknown calls onto the decorated object.
*
* @param string $method
* The method to call on the decorated plugin discovery.
* @param array $args
* The arguments to send to the method.
*
* @return mixed
* The method result.
*/
public function __call($method, $args) {
return call_user_func_array([$this->decorated, $method], $args);
}
}
@@ -1,39 +0,0 @@
<?php
namespace Drupal\Component\Annotation;
/**
* Defines a Plugin annotation object that just contains an ID.
*
* @Annotation
*/
class PluginID extends AnnotationBase {
/**
* The plugin ID.
*
* When an annotation is given no key, 'value' is assumed by Doctrine.
*
* @var string
*/
public $value;
/**
* {@inheritdoc}
*/
public function get() {
return [
'id' => $this->value,
'class' => $this->class,
'provider' => $this->provider,
];
}
/**
* {@inheritdoc}
*/
public function getId() {
return $this->value;
}
}
@@ -1,12 +0,0 @@
The Drupal Annotation Component
Thanks for using this Drupal component.
You can participate in its development on Drupal.org, through our issue system:
https://www.drupal.org/project/issues/drupal
You can get the full Drupal repo here:
https://www.drupal.org/project/drupal/git-instructions
You can browse the full Drupal repo here:
https://git.drupalcode.org/project/drupal
@@ -1,39 +0,0 @@
<?php
namespace Drupal\Component\Annotation\Reflection;
use Doctrine\Common\Reflection\ClassFinderInterface;
/**
* Defines a mock file finder that only returns a single filename.
*
* This can be used with Doctrine\Common\Reflection\StaticReflectionParser if
* the filename is known and inheritance is not a concern (for example, if
* only the class annotation is needed).
*/
class MockFileFinder implements ClassFinderInterface {
/**
* The only filename this finder ever returns.
*
* @var string
*/
protected $filename;
/**
* {@inheritdoc}
*/
public function findFile($class) {
return $this->filename;
}
/**
* Creates new mock file finder objects.
*/
public static function create($filename) {
$object = new static();
$object->filename = $filename;
return $object;
}
}
@@ -1,18 +0,0 @@
HOW-TO: Test this Drupal component
In order to test this component, you'll need to get the entire Drupal repo and
run the tests there.
You'll find the tests under core/tests/Drupal/Tests/Component.
You can get the full Drupal repo here:
https://www.drupal.org/project/drupal/git-instructions
You can find more information about running PHPUnit tests with Drupal here:
https://www.drupal.org/node/2116263
Each component in the Drupal\Component namespace has its own annotated test
group. You can use this group to run only the tests for this component. Like
this:
$ ./vendor/bin/phpunit -c core --group Annotation
@@ -1,20 +0,0 @@
{
"name": "drupal/core-annotation",
"description": "Annotation discovery and implementation of plugins.",
"keywords": ["drupal"],
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0.8",
"doctrine/common": "^2.7",
"doctrine/annotations": "^1.4",
"drupal/core-file-cache": "^8.8",
"drupal/core-plugin": "^8.8",
"drupal/core-utility": "^8.8"
},
"autoload": {
"psr-4": {
"Drupal\\Component\\Annotation\\": ""
}
}
}

Some files were not shown because too many files have changed in this diff Show More