Update to drupal-org-drupal 8.0.0-rc2. For more information, see https://www.drupal.org/node/2598668

This commit is contained in:
Pantheon Automation 2015-10-21 21:44:50 -07:00 committed by Greg Anderson
parent f32e58e4b1
commit 8e18df8c36
3062 changed files with 15044 additions and 172506 deletions

View file

@ -71,6 +71,7 @@
"object-curly-spacing": [2, "never"], "object-curly-spacing": [2, "never"],
"one-var": [2, "never"], "one-var": [2, "never"],
"quote-props": [2, "consistent-as-needed"], "quote-props": [2, "consistent-as-needed"],
"quotes": [2, "single", "avoid-escape"],
"semi": [2, "always"], "semi": [2, "always"],
"semi-spacing": [2, {"before": false, "after": true}], "semi-spacing": [2, {"before": false, "after": true}],
"space-after-keywords": [2, "always"], "space-after-keywords": [2, "always"],

View file

@ -37,6 +37,8 @@
}, },
"scripts": { "scripts": {
"pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump", "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
"post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess" "post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
"post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup"
} }
} }

View file

@ -26,8 +26,8 @@ Drupal requires:
compatible drop-in replacement for MySQL. compatible drop-in replacement for MySQL.
- Percona Server 5.5.8 (or greater) (http://www.percona.com/). Percona - Percona Server 5.5.8 (or greater) (http://www.percona.com/). Percona
Server is a backwards-compatible replacement for MySQL. Server is a backwards-compatible replacement for MySQL.
- PostgreSQL 8.3 (or greater) (http://www.postgresql.org/). - PostgreSQL 9.1.2 (or greater) (http://www.postgresql.org/).
- SQLite 3.4.2 (or greater) (http://www.sqlite.org/). - SQLite 3.6.8 (or greater) (http://www.sqlite.org/).
For more detailed information about Drupal requirements, including a list of For more detailed information about Drupal requirements, including a list of
PHP extensions and configurations that are required, see "System requirements" PHP extensions and configurations that are required, see "System requirements"

View file

@ -1,17 +1,24 @@
INTRODUCTION INTRODUCTION
------------ ------------
This document describes how to: This document describes how to update your Drupal site between 8.x.x minor and
patch versions; for example, from 8.1.2 to 8.1.3, or from 8.3.5 to 8.4.0.
* Update your Drupal site from one minor 8.x version to another minor 8.x To upgrade from a previous major version (for example, Drupal 6 or 7), the
version; for example, from 8.8 to 8.9, or from 8.6 to 8.10. process involves importing site configuration and content from your old site
into a new Drupal 8 site. The tools and process are currently experimental,
* Migrate your Drupal site to version 8.x. rather than being fully supported, so be sure to test in a development
environment. You will need to use the contributed Drupal Upgrade module
(https://www.drupal.org/project/migrate_upgrade), as well as the core Migrate
and Migrate Drupal modules. See https://www.drupal.org/upgrade/migrate for
details, and https://www.drupal.org/node/2167633 for known issues.
First steps and definitions: First steps and definitions:
* If you are upgrading to Drupal version x.y, then x is known as the major * If you are upgrading to Drupal version x.y.z, then x is known as the major
version number, and y is known as the minor version number. The download version number, y is known as the minor version number, and z is known as
file will be named drupal-x.y.tar.gz (or drupal-x.y.zip). the patch version number. The download file will be named
drupal-x.y.z.tar.gz (or drupal-x.y.z.zip). Previous Drupal versions used
only x.y (MAJOR.MINOR) to designate their versions.
* All directories mentioned in this document are relative to the directory of * All directories mentioned in this document are relative to the directory of
your Drupal installation. your Drupal installation.
@ -46,9 +53,9 @@ If you encounter errors during this process,
More in-depth information on upgrading can be found at More in-depth information on upgrading can be found at
https://www.drupal.org/upgrade https://www.drupal.org/upgrade
MINOR VERSION UPDATES MINOR AND PATCH VERSION UPDATES
--------------------- -------------------------------
To update from one minor 8.x version of Drupal to any later 8.x version, after To update from one 8.x.x version of Drupal to any later 8.x.x version, after
following the instructions in the INTRODUCTION section at the top of this file: following the instructions in the INTRODUCTION section at the top of this file:
1. Log in as a user with the permission "Administer software updates". 1. Log in as a user with the permission "Administer software updates".
@ -87,20 +94,20 @@ following the instructions in the INTRODUCTION section at the top of this file:
this page you can scroll down or use the filter to find your version and its this page you can scroll down or use the filter to find your version and its
release notes. release notes.
4. Download the latest Drupal 8.x release from https://www.drupal.org to a 4. Download the latest Drupal 8.x.x release from https://www.drupal.org to a
directory outside of your web root. Extract the archive and copy the files directory outside of your web root. Extract the archive and copy the files
into your Drupal directory. into your Drupal directory.
On a typical Unix/Linux command line, use the following commands to download On a typical Unix/Linux command line, use the following commands to download
and extract: and extract:
wget https://www.drupal.org/files/projects/drupal-x.y.tar.gz wget https://www.drupal.org/files/projects/drupal-x.y.z.tar.gz
tar -zxvf drupal-x.y.tar.gz tar -zxvf drupal-x.y.z.tar.gz
This creates a new directory drupal-x.y/ containing all Drupal files and This creates a new directory drupal-x.y.z/ containing all Drupal files and
directories. Copy the files into your Drupal installation directory: directories. Copy the files into your Drupal installation directory:
cp -R drupal-x.y/* drupal-x.y/.htaccess /path/to/your/installation cp -R drupal-x.y.z/* drupal-x.y.z/.htaccess /path/to/your/installation
If you do not have command line access to your server, download the archive If you do not have command line access to your server, download the archive
from https://www.drupal.org using your web browser, extract it, and then use from https://www.drupal.org using your web browser, extract it, and then use
@ -135,10 +142,3 @@ following the instructions in the INTRODUCTION section at the top of this file:
Disable the "Put site into maintenance mode" checkbox and save the Disable the "Put site into maintenance mode" checkbox and save the
configuration. configuration.
MAJOR VERSION MIGRATION
-----------------------
Upgrading from a prior major version of Drupal to Drupal 8.x is not possible.
The process now requires a migration to a Drupal 8.x site, using the Migrate
module in Drupal core.
Note that migration support in Drupal 8 is currently only partially implemented.

View file

@ -1,4 +1,3 @@
/* Modernizr 2.8.3 (Custom Build) | MIT & BSD /*! modernizr 3.1.0 (Custom Build) | MIT *
* Build: http://modernizr.com/download/#-inputtypes-touch-cssclasses-addtest-teststyles-prefixes-elem_details * http://modernizr.com/download/?-details-inputtypes-touchevents-addtest-prefixes-teststyles !*/
*/ !function(e,t,n){function o(e,t){return typeof e===t}function i(){var e,t,n,i,s,a,r;for(var l in u){if(e=[],t=u[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(i=o(t.fn,"function")?t.fn():t.fn,s=0;s<e.length;s++)a=e[s],r=a.split("."),1===r.length?Modernizr[r[0]]=i:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=i),c.push((i?"":"no-")+r.join("-"))}}function s(e){var t=p.className,n=Modernizr._config.classPrefix||"";if(h&&(t=t.baseVal),Modernizr._config.enableJSClass){var o=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(o,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(t+=" "+n+e.join(" "+n),h?p.className.baseVal=t:p.className=t)}function a(e,t){if("object"==typeof e)for(var n in e)v(e,n)&&a(n,e[n]);else{e=e.toLowerCase();var o=e.split("."),i=Modernizr[o[0]];if(2==o.length&&(i=i[o[1]]),"undefined"!=typeof i)return Modernizr;t="function"==typeof t?t():t,1==o.length?Modernizr[o[0]]=t:(!Modernizr[o[0]]||Modernizr[o[0]]instanceof Boolean||(Modernizr[o[0]]=new Boolean(Modernizr[o[0]])),Modernizr[o[0]][o[1]]=t),s([(t&&0!=t?"":"no-")+o.join("-")]),Modernizr._trigger(e,t)}return Modernizr}function r(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):h?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function l(){var e=t.body;return e||(e=r(h?"svg":"body"),e.fake=!0),e}function f(e,n,o,i){var s,a,f,u,d="modernizr",c=r("div"),h=l();if(parseInt(o,10))for(;o--;)f=r("div"),f.id=i?i[o]:d+(o+1),c.appendChild(f);return s=r("style"),s.type="text/css",s.id="s"+d,(h.fake?h:c).appendChild(s),h.appendChild(c),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(t.createTextNode(e)),c.id=d,h.fake&&(h.style.background="",h.style.overflow="hidden",u=p.style.overflow,p.style.overflow="hidden",p.appendChild(h)),a=n(c,e),h.fake?(h.parentNode.removeChild(h),p.style.overflow=u,p.offsetHeight):c.parentNode.removeChild(c),!!a}var u=[],d={_version:"3.1.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){u.push({name:e,fn:t,options:n})},addAsyncTest:function(e){u.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=d,Modernizr=new Modernizr;var c=[],p=t.documentElement,h="svg"===p.nodeName.toLowerCase(),m=d._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):[];d._prefixes=m;var v;!function(){var e={}.hasOwnProperty;v=o(e,"undefined")||o(e.call,"undefined")?function(e,t){return t in e&&o(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),d._l={},d.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},d._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,o;for(e=0;e<n.length;e++)(o=n[e])(t)},0),delete this._l[e]}},Modernizr._q.push(function(){d.addTest=a});var y=d.testStyles=f,g=r("input"),_="search tel url email datetime date month week time datetime-local number range color".split(" "),w={};Modernizr.inputtypes=function(e){for(var o,i,s,a=e.length,r=":)",l=0;a>l;l++)g.setAttribute("type",o=e[l]),s="text"!==g.type&&"style"in g,s&&(g.value=r,g.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(o)&&g.style.WebkitAppearance!==n?(p.appendChild(g),i=t.defaultView,s=i.getComputedStyle&&"textfield"!==i.getComputedStyle(g,null).WebkitAppearance&&0!==g.offsetHeight,p.removeChild(g)):/^(search|tel)$/.test(o)||(s=/^(url|email|number)$/.test(o)?g.checkValidity&&g.checkValidity()===!1:g.value!=r)),w[e[l]]=!!s;return w}(_),Modernizr.addTest("touchevents",function(){var n;if("ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch)n=!0;else{var o=["@media (",m.join("touch-enabled),("),"heartz",")","{#modernizr{top:9px;position:absolute}}"].join("");y(o,function(e){n=9===e.offsetTop})}return n}),Modernizr.addTest("details",function(){var e,t=r("details");return"open"in t?(y("#modernizr details{display:block}",function(n){n.appendChild(t),t.innerHTML="<summary>a</summary>b",e=t.offsetHeight,t.open=!0,e=e!=t.offsetHeight}),e):!1}),i(),s(c),delete d.addTest,delete d.addAsyncTest;for(var b=0;b<Modernizr._q.length;b++)Modernizr._q[b]();e.Modernizr=Modernizr}(window,document);
;window.Modernizr=function(a,b,c){function x(a){j.cssText=a}function y(a,b){return x(n.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function A(a,b){return!!~(""+a).indexOf(b)}function B(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}function C(){e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),p[a[d]]=!!e;return p}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o={},p={},q={},r=[],s=r.slice,t,u=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},v={}.hasOwnProperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=s.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(s.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(s.call(arguments)))};return e}),o.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:u(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var D in o)w(o,D)&&(t=D.toLowerCase(),e[t]=o[D](),r.push((e[t]?"":"no-")+t));return e.input||C(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)w(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},x(""),i=k=null,e._version=d,e._prefixes=n,e.testStyles=u,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+r.join(" "):""),e}(this,this.document),Modernizr.addTest("details",function(){var a=document,b=a.createElement("details"),c,d,e;return"open"in b?(d=a.body||function(){var b=a.documentElement;return c=!0,b.insertBefore(a.createElement("body"),b.firstElementChild||b.firstChild)}(),b.innerHTML="<summary>a</summary>b",b.style.display="block",d.appendChild(b),e=b.offsetHeight,b.open=!0,e=e!=b.offsetHeight,d.removeChild(b),c&&d.parentNode.removeChild(d),e):!1});

View file

@ -821,7 +821,7 @@ modernizr:
name: MIT name: MIT
url: http://modernizr.com/license/ url: http://modernizr.com/license/
gpl-compatible: true gpl-compatible: true
version: "v2.8.3" version: "v3.1.0"
js: js:
assets/vendor/modernizr/modernizr.min.js: { preprocess: 0, weight: -21, minified: true } assets/vendor/modernizr/modernizr.min.js: { preprocess: 0, weight: -21, minified: true }

View file

@ -16,6 +16,7 @@ parameters:
tags: [] tags: []
factory.keyvalue: factory.keyvalue:
default: keyvalue.database default: keyvalue.database
http.response.debug_cacheability_headers: false
factory.keyvalue.expirable: factory.keyvalue.expirable:
default: keyvalue.expirable.database default: keyvalue.expirable.database
filter_protocols: filter_protocols:
@ -1070,7 +1071,7 @@ services:
class: Drupal\Core\EventSubscriber\FinishResponseSubscriber class: Drupal\Core\EventSubscriber\FinishResponseSubscriber
tags: tags:
- { name: event_subscriber } - { name: event_subscriber }
arguments: ['@language_manager', '@config.factory', '@page_cache_request_policy', '@page_cache_response_policy', '@cache_contexts_manager'] arguments: ['@language_manager', '@config.factory', '@page_cache_request_policy', '@page_cache_response_policy', '@cache_contexts_manager', '%http.response.debug_cacheability_headers%']
response_generator_subscriber: response_generator_subscriber:
class: Drupal\Core\EventSubscriber\ResponseGeneratorSubscriber class: Drupal\Core\EventSubscriber\ResponseGeneratorSubscriber
tags: tags:

View file

@ -14,7 +14,6 @@
* @see batch_get() * @see batch_get()
*/ */
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\Timer; use Drupal\Component\Utility\Timer;
use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Batch\Percentage; use Drupal\Core\Batch\Percentage;

View file

@ -4,23 +4,15 @@
* Functions that need to be loaded on every Drupal request. * Functions that need to be loaded on every Drupal request.
*/ */
use Drupal\Component\Datetime\DateTimePlus;
use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Environment;
use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Unicode;
use Drupal\Core\DrupalKernel;
use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\Logger\RfcLogLevel; use Drupal\Core\Logger\RfcLogLevel;
use Drupal\Core\Render\Markup; use Drupal\Core\Render\Markup;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
use Drupal\Core\Utility\Error; use Drupal\Core\Utility\Error;
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\Language\LanguageInterface;
/** /**
* Minimum supported version of PHP. * Minimum supported version of PHP.

View file

@ -9,35 +9,18 @@
*/ */
use Drupal\Component\Serialization\Json; use Drupal\Component\Serialization\Json;
use Drupal\Component\Serialization\Yaml;
use Drupal\Component\Serialization\Exception\InvalidDataTypeException;
use Drupal\Component\Utility\Bytes; use Drupal\Component\Utility\Bytes;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Number;
use Drupal\Component\Utility\SortArray; use Drupal\Component\Utility\SortArray;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\Tags;
use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Asset\AttachedAssets;
use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Render\Markup; use Drupal\Core\Render\Markup;
use Drupal\Core\Render\Renderer; use Drupal\Core\Render\Renderer;
use Drupal\Core\Site\Settings;
use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Url;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\PhpStorage\PhpStorageFactory; use Drupal\Core\PhpStorage\PhpStorageFactory;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\Core\Routing\GeneratorNotInitializedException;
use Drupal\Core\StringTranslation\PluralTranslatableMarkup; use Drupal\Core\StringTranslation\PluralTranslatableMarkup;
use Drupal\Core\Template\Attribute;
use Drupal\Core\Render\BubbleableMetadata; use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Core\Render\Element; use Drupal\Core\Render\Element;
use Drupal\Core\Session\AnonymousUserSession;
/** /**
* @defgroup php_wrappers PHP wrapper functions * @defgroup php_wrappers PHP wrapper functions

View file

@ -5,8 +5,6 @@
* Entity API for handling entities like nodes or users. * Entity API for handling entities like nodes or users.
*/ */
use Drupal\Core\Cache\Cache;
use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
/** /**

View file

@ -5,14 +5,12 @@
* API for handling file uploads and server file management. * API for handling file uploads and server file management.
*/ */
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\UrlHelper;
use Drupal\Component\PhpStorage\FileStorage; use Drupal\Component\PhpStorage\FileStorage;
use Drupal\Component\Utility\Bytes; use Drupal\Component\Utility\Bytes;
use Drupal\Core\File\FileSystem; use Drupal\Core\File\FileSystem;
use Drupal\Core\StreamWrapper\PublicStream; use Drupal\Core\StreamWrapper\PublicStream;
use Drupal\Core\StreamWrapper\StreamWrapperInterface;
use Drupal\Core\StreamWrapper\PrivateStream; use Drupal\Core\StreamWrapper\PrivateStream;
/** /**

View file

@ -5,12 +5,7 @@
* Functions for form and batch generation and processing. * Functions for form and batch generation and processing.
*/ */
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\UrlHelper;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Database\Database;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Form\OptGroup;
use Drupal\Core\Render\Element; use Drupal\Core\Render\Element;
use Drupal\Core\Template\Attribute; use Drupal\Core\Template\Attribute;
use Drupal\Core\Url; use Drupal\Core\Url;

View file

@ -1,6 +1,5 @@
<?php <?php
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\DrupalKernel; use Drupal\Core\DrupalKernel;
use Drupal\Core\Config\BootstrapConfigStorageFactory; use Drupal\Core\Config\BootstrapConfigStorageFactory;

View file

@ -5,7 +5,6 @@
* API for loading and interacting with Drupal modules. * API for loading and interacting with Drupal modules.
*/ */
use Drupal\Core\Cache\Cache;
use Drupal\Core\Extension\ExtensionDiscovery; use Drupal\Core\Extension\ExtensionDiscovery;
/** /**

View file

@ -5,7 +5,6 @@
* Functions to aid in presenting database results as a set of pages. * Functions to aid in presenting database results as a set of pages.
*/ */
use Drupal\Core\Template\Attribute;
use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\UrlHelper;
/** /**

View file

@ -5,8 +5,6 @@
* Schema API handling functions. * Schema API handling functions.
*/ */
use Drupal\Core\Database\Database;
/** /**
* @addtogroup schemaapi * @addtogroup schemaapi
* @{ * @{

View file

@ -14,7 +14,6 @@ use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Render\MarkupInterface; use Drupal\Component\Render\MarkupInterface;
use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Config\Config; use Drupal\Core\Config\Config;
use Drupal\Core\Config\StorageException; use Drupal\Core\Config\StorageException;
use Drupal\Core\Render\RenderableInterface; use Drupal\Core\Render\RenderableInterface;
@ -386,7 +385,7 @@ function theme_get_setting($setting_name, $theme = NULL) {
* https://www.drupal.org/node/2575065 * https://www.drupal.org/node/2575065
*/ */
function theme_render_and_autoescape($arg) { function theme_render_and_autoescape($arg) {
if ($arg instanceOf MarkupInterface) { if ($arg instanceof MarkupInterface) {
return (string) $arg; return (string) $arg;
} }
$return = NULL; $return = NULL;
@ -1578,7 +1577,7 @@ function template_preprocess_field_multiple_value_form(&$variables) {
'data' => array( 'data' => array(
'#prefix' => '<h4' . $header_attributes . '>', '#prefix' => '<h4' . $header_attributes . '>',
'title' => array( 'title' => array(
'#markup' => t($element['#title']), '#markup' => $element['#title'],
), ),
'#suffix' => '</h4>', '#suffix' => '</h4>',
), ),

View file

@ -9,7 +9,6 @@
*/ */
use Drupal\Component\Graph\Graph; use Drupal\Component\Graph\Graph;
use Drupal\Component\Utility\Html;
use Drupal\Core\Utility\Error; use Drupal\Core\Utility\Error;
/** /**

View file

@ -5,7 +5,6 @@
* Miscellaneous functions. * Miscellaneous functions.
*/ */
use Drupal\Component\Utility\Variable;
use Drupal\Core\PhpStorage\PhpStorageFactory; use Drupal\Core\PhpStorage\PhpStorageFactory;
use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\Cache;
use Drupal\Core\DrupalKernel; use Drupal\Core\DrupalKernel;

View file

@ -81,7 +81,7 @@ class Drupal {
/** /**
* The current system version. * The current system version.
*/ */
const VERSION = '8.0.0-rc1'; const VERSION = '8.0.0-rc2';
/** /**
* Core API compatibility. * Core API compatibility.

View file

@ -203,7 +203,7 @@ class DateTimePlus {
$datetimeplus = new static('', $timezone, $settings); $datetimeplus = new static('', $timezone, $settings);
$date = \DateTime::createFromFormat($format, $time, $datetimeplus->getTimezone()); $date = \DateTime::createFromFormat($format, $time, $datetimeplus->getTimezone());
if (!$date instanceOf \DateTime) { if (!$date instanceof \DateTime) {
throw new \Exception('The date cannot be created from a format.'); throw new \Exception('The date cannot be created from a format.');
} }
else { else {
@ -212,10 +212,10 @@ class DateTimePlus {
// re-creating the date/time formatted string and comparing it to the input. For // re-creating the date/time formatted string and comparing it to the input. For
// instance, an input value of '11' using a format of Y (4 digits) gets // instance, an input value of '11' using a format of Y (4 digits) gets
// created as '0011' instead of '2011'. // created as '0011' instead of '2011'.
if ($date instanceOf DateTimePlus) { if ($date instanceof DateTimePlus) {
$test_time = $date->format($format, $settings); $test_time = $date->format($format, $settings);
} }
elseif ($date instanceOf \DateTime) { elseif ($date instanceof \DateTime) {
$test_time = $date->format($format); $test_time = $date->format($format);
} }
$datetimeplus->setTimestamp($date->getTimestamp()); $datetimeplus->setTimestamp($date->getTimestamp());
@ -345,7 +345,7 @@ class DateTimePlus {
*/ */
protected function prepareTimezone($timezone) { protected function prepareTimezone($timezone) {
// If the input timezone is a valid timezone object, use it. // If the input timezone is a valid timezone object, use it.
if ($timezone instanceOf \DateTimezone) { if ($timezone instanceof \DateTimezone) {
$timezone_adjusted = $timezone; $timezone_adjusted = $timezone;
} }
@ -356,7 +356,7 @@ class DateTimePlus {
// Default to the system timezone when not explicitly provided. // Default to the system timezone when not explicitly provided.
// If the system timezone is missing, use 'UTC'. // If the system timezone is missing, use 'UTC'.
if (empty($timezone_adjusted) || !$timezone_adjusted instanceOf \DateTimezone) { if (empty($timezone_adjusted) || !$timezone_adjusted instanceof \DateTimezone) {
$system_timezone = date_default_timezone_get(); $system_timezone = date_default_timezone_get();
$timezone_name = !empty($system_timezone) ? $system_timezone : 'UTC'; $timezone_name = !empty($system_timezone) ? $system_timezone : 'UTC';
$timezone_adjusted = new \DateTimeZone($timezone_name); $timezone_adjusted = new \DateTimeZone($timezone_name);

View file

@ -19,7 +19,7 @@ use Drupal\Component\Utility\Unicode;
* More ideas are taken from: * More ideas are taken from:
* http://www.ics.uci.edu/~eppstein/161/960229.html * http://www.ics.uci.edu/~eppstein/161/960229.html
* *
* Some ideas are (and a bit of code) are from from analyze.c, from GNU * Some ideas (and a bit of code) are from analyze.c, from GNU
* diffutils-2.7, which can be found at: * diffutils-2.7, which can be found at:
* ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz * ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz
* *

View file

@ -7,10 +7,6 @@
namespace Drupal\Component\Gettext; namespace Drupal\Component\Gettext;
use Drupal\Component\Gettext\PoWriterInterface;
use Drupal\Component\Gettext\PoHeader;
use Drupal\Component\Gettext\PoItem;
/** /**
* Defines a Gettext PO memory writer, to be used by the installer. * Defines a Gettext PO memory writer, to be used by the installer.
*/ */

View file

@ -7,8 +7,6 @@
namespace Drupal\Component\Gettext; namespace Drupal\Component\Gettext;
use Drupal\Component\Gettext\PoHeader;
/** /**
* Methods required for both reader and writer implementations. * Methods required for both reader and writer implementations.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Component\Gettext; namespace Drupal\Component\Gettext;
use Drupal\Component\Gettext\PoMetadataInterface;
/** /**
* Shared interface definition for all Gettext PO Readers. * Shared interface definition for all Gettext PO Readers.
*/ */

View file

@ -7,9 +7,6 @@
namespace Drupal\Component\Gettext; namespace Drupal\Component\Gettext;
use Drupal\Component\Gettext\PoReaderInterface;
use Drupal\Component\Gettext\PoStreamInterface;
use Drupal\Component\Gettext\PoHeader;
use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\SafeMarkup;
/** /**

View file

@ -7,12 +7,6 @@
namespace Drupal\Component\Gettext; namespace Drupal\Component\Gettext;
use Drupal\Component\Gettext\PoHeader;
use Drupal\Component\Gettext\PoItem;
use Drupal\Component\Gettext\PoReaderInterface;
use Drupal\Component\Gettext\PoWriterInterface;
use Drupal\Component\Gettext\PoStreamInterface;
/** /**
* Defines a Gettext PO stream writer. * Defines a Gettext PO stream writer.
*/ */

View file

@ -7,9 +7,6 @@
namespace Drupal\Component\Gettext; namespace Drupal\Component\Gettext;
use Drupal\Component\Gettext\PoMetadataInterface;
use Drupal\Component\Gettext\PoItem;
/** /**
* Shared interface definition for all Gettext PO Writers. * Shared interface definition for all Gettext PO Writers.
*/ */

View file

@ -33,11 +33,21 @@ abstract class SecuredRedirectResponse extends RedirectResponse {
*/ */
public static function createFromRedirectResponse(RedirectResponse $response) { public static function createFromRedirectResponse(RedirectResponse $response) {
$safe_response = new static($response->getTargetUrl(), $response->getStatusCode(), $response->headers->allPreserveCase()); $safe_response = new static($response->getTargetUrl(), $response->getStatusCode(), $response->headers->allPreserveCase());
$safe_response->setProtocolVersion($response->getProtocolVersion()); $safe_response->fromResponse($response);
$safe_response->setCharset($response->getCharset());
return $safe_response; return $safe_response;
} }
/**
* Copies over the values from the given response.
*
* @param \Symfony\Component\HttpFoundation\RedirectResponse $response
* The redirect reponse object.
*/
protected function fromResponse(RedirectResponse $response) {
$this->setProtocolVersion($response->getProtocolVersion());
$this->setCharset($response->getCharset());
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View file

@ -6,7 +6,6 @@
namespace Drupal\Component\Plugin\Exception; namespace Drupal\Component\Plugin\Exception;
use Drupal\Component\Plugin\Exception\ExceptionInterface;
use \BadMethodCallException; use \BadMethodCallException;
/** /**

View file

@ -41,7 +41,7 @@ class SafeMarkup {
* \Drupal\Component\Render\MarkupInterface. * \Drupal\Component\Render\MarkupInterface.
*/ */
public static function isSafe($string, $strategy = 'html') { public static function isSafe($string, $strategy = 'html') {
return $string instanceOf MarkupInterface; return $string instanceof MarkupInterface;
} }
/** /**

View file

@ -8,7 +8,6 @@
namespace Drupal\Core\Action; namespace Drupal\Core\Action;
use Drupal\Component\Plugin\ConfigurablePluginInterface; use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Core\Action\ActionBase;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginFormInterface; use Drupal\Core\Plugin\PluginFormInterface;

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* An AJAX command for adding css to the page via ajax. * An AJAX command for adding css to the page via ajax.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\InsertCommand;
/** /**
* An AJAX command for calling the jQuery after() method. * An AJAX command for calling the jQuery after() method.
* *

View file

@ -7,15 +7,10 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Asset\AttachedAssets;
use Drupal\Core\Render\BubbleableMetadata; use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Core\Render\Renderer;
use Drupal\Core\Render\AttachmentsInterface; use Drupal\Core\Render\AttachmentsInterface;
use Drupal\Core\Render\AttachmentsTrait; use Drupal\Core\Render\AttachmentsTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/** /**
* JSON response object for AJAX requests. * JSON response object for AJAX requests.

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* AJAX command for a javascript alert box. * AJAX command for a javascript alert box.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\InsertCommand;
/** /**
* An AJAX command for calling the jQuery append() method. * An AJAX command for calling the jQuery append() method.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\InsertCommand;
/** /**
* An AJAX command for calling the jQuery before() method. * An AJAX command for calling the jQuery before() method.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* An AJAX command for marking HTML elements as changed. * An AJAX command for marking HTML elements as changed.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CloseDialogCommand;
/** /**
* Defines an AJAX command that closes the currently visible modal dialog. * Defines an AJAX command that closes the currently visible modal dialog.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* An AJAX command for calling the jQuery css() method. * An AJAX command for calling the jQuery css() method.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* An AJAX command for implementing jQuery's data() method. * An AJAX command for implementing jQuery's data() method.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\InsertCommand;
/** /**
* AJAX command for calling the jQuery html() method. * AJAX command for calling the jQuery html() method.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* Generic AJAX command for inserting content. * Generic AJAX command for inserting content.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* AJAX command for invoking an arbitrary jQuery method. * AJAX command for invoking an arbitrary jQuery method.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* Defines an AJAX command to open certain content in a dialog. * Defines an AJAX command to open certain content in a dialog.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\OpenDialogCommand;
/** /**
* Defines an AJAX command to open certain content in a dialog in a modal dialog. * Defines an AJAX command to open certain content in a dialog in a modal dialog.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\InsertCommand;
/** /**
* AJAX command for calling the jQuery insert() method. * AJAX command for calling the jQuery insert() method.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* Defines an AJAX command to set the window.location, loading that URL. * Defines an AJAX command to set the window.location, loading that URL.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* AJAX command for calling the jQuery remove() method. * AJAX command for calling the jQuery remove() method.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\InsertCommand;
/** /**
* AJAX command for calling the jQuery replace() method. * AJAX command for calling the jQuery replace() method.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* AJAX command for resetting the striping on a table. * AJAX command for resetting the striping on a table.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\SetDialogOptionCommand;
/** /**
* Defines an AJAX command that sets jQuery UI dialog properties. * Defines an AJAX command that sets jQuery UI dialog properties.
* *

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Ajax; namespace Drupal\Core\Ajax;
use Drupal\Core\Ajax\CommandInterface;
/** /**
* AJAX command for adjusting Drupal's JavaScript settings. * AJAX command for adjusting Drupal's JavaScript settings.
* *

View file

@ -7,7 +7,6 @@
namespace Drupal\Core\Asset; namespace Drupal\Core\Asset;
use Drupal\Core\Asset\AssetDumperInterface;
use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\Crypt;
/** /**

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Asset; namespace Drupal\Core\Asset;
use Drupal\Core\Asset\AssetCollectionGrouperInterface;
/** /**
* Groups CSS assets. * Groups CSS assets.
*/ */

View file

@ -7,7 +7,6 @@
namespace Drupal\Core\Asset; namespace Drupal\Core\Asset;
use Drupal\Core\Asset\AssetOptimizerInterface;
use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Unicode;
/** /**

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Asset; namespace Drupal\Core\Asset;
use Drupal\Core\Asset\AssetCollectionGrouperInterface;
/** /**
* Groups JavaScript assets. * Groups JavaScript assets.
*/ */

View file

@ -7,7 +7,6 @@
namespace Drupal\Core\Asset; namespace Drupal\Core\Asset;
use Drupal\Core\Asset\AssetOptimizerInterface;
use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Unicode;
/** /**

View file

@ -11,7 +11,6 @@ use Drupal\Core\Asset\Exception\IncompleteLibraryDefinitionException;
use Drupal\Core\Asset\Exception\InvalidLibrariesOverrideSpecificationException; use Drupal\Core\Asset\Exception\InvalidLibrariesOverrideSpecificationException;
use Drupal\Core\Asset\Exception\InvalidLibraryFileException; use Drupal\Core\Asset\Exception\InvalidLibraryFileException;
use Drupal\Core\Asset\Exception\LibraryDefinitionMissingLicenseException; use Drupal\Core\Asset\Exception\LibraryDefinitionMissingLicenseException;
use Drupal\Core\Extension\Extension;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Theme\ThemeManagerInterface; use Drupal\Core\Theme\ThemeManagerInterface;
use Drupal\Component\Serialization\Exception\InvalidDataTypeException; use Drupal\Component\Serialization\Exception\InvalidDataTypeException;

View file

@ -68,7 +68,7 @@ class ApcuBackend implements CacheBackendInterface {
* @return string * @return string
* The APCu key for the cache item ID. * The APCu key for the cache item ID.
*/ */
protected function getApcuKey($cid) { public function getApcuKey($cid) {
return $this->binPrefix . $cid; return $this->binPrefix . $cid;
} }
@ -178,14 +178,8 @@ class ApcuBackend implements CacheBackendInterface {
$cache->serialized = 0; $cache->serialized = 0;
$cache->data = $data; $cache->data = $data;
// apc_store()'s $ttl argument can be omitted but also set to 0 (zero), // Expiration is handled by our own prepareItem(), not APCu.
// in which case the value will persist until it's removed from the cache or apc_store($this->getApcuKey($cid), $cache);
// until the next cache clear, restart, etc. This is what we want to do
// when $expire equals CacheBackendInterface::CACHE_PERMANENT.
if ($expire === CacheBackendInterface::CACHE_PERMANENT) {
$expire = 0;
}
apc_store($this->getApcuKey($cid), $cache, $expire);
} }
/** /**

View file

@ -13,7 +13,6 @@ namespace Drupal\Core\Cache;
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class CacheFactory implements CacheFactoryInterface, ContainerAwareInterface { class CacheFactory implements CacheFactoryInterface, ContainerAwareInterface {

View file

@ -0,0 +1,26 @@
<?php
/**
* @file
* Contains \Drupal\Core\Cache\CacheableRedirectResponse.
*/
namespace Drupal\Core\Cache;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
* A RedirectResponse that contains and can expose cacheability metadata.
*
* Supports Drupal's caching concepts: cache tags for invalidation and cache
* contexts for variations.
*
* @see \Drupal\Core\Cache\Cache
* @see \Drupal\Core\Cache\CacheableMetadata
* @see \Drupal\Core\Cache\CacheableResponseTrait
*/
class CacheableRedirectResponse extends RedirectResponse implements CacheableResponseInterface {
use CacheableResponseTrait;
}

View file

@ -9,6 +9,7 @@ namespace Drupal\Core\Composer;
use Drupal\Component\PhpStorage\FileStorage; use Drupal\Component\PhpStorage\FileStorage;
use Composer\Script\Event; use Composer\Script\Event;
use Composer\Installer\PackageEvent;
/** /**
* Provides static functions for composer script events. * Provides static functions for composer script events.
@ -17,6 +18,56 @@ use Composer\Script\Event;
*/ */
class Composer { class Composer {
protected static $packageToCleanup = [
'behat/mink' => ['tests', 'driver-testsuite'],
'behat/mink-browserkit-driver' => ['tests'],
'behat/mink-goutte-driver' => ['tests'],
'doctrine/cache' => ['tests'],
'doctrine/collections' => ['tests'],
'doctrine/common' => ['tests'],
'doctrine/inflector' => ['tests'],
'doctrine/instantiator' => ['tests'],
'egulias/email-validator' => ['documentation', 'tests'],
'fabpot/goutte' => ['Goutte/Tests'],
'guzzlehttp/promises' => ['tests'],
'guzzlehttp/psr7' => ['tests'],
'masterminds/html5' => ['test'],
'mikey179/vfsStream' => ['src/test'],
'phpdocumentor/reflection-docblock' => ['tests'],
'phpunit/php-code-coverage' => ['tests'],
'phpunit/php-timer' => ['tests'],
'phpunit/php-token-stream' => ['tests'],
'phpunit/phpunit' => ['tests'],
'phpunit/php-mock-objects' => ['tests'],
'sebastian/comparator' => ['tests'],
'sebastian/diff' => ['tests'],
'sebastian/environment' => ['tests'],
'sebastian/exporter' => ['tests'],
'sebastian/global-state' => ['tests'],
'sebastian/recursion-context' => ['tests'],
'stack/builder' => ['tests'],
'symfony/browser-kit' => ['Tests'],
'symfony/class-loader' => ['Tests'],
'symfony/console' => ['Tests'],
'symfony/css-selector' => ['Tests'],
'symfony/debug' => ['Tests'],
'symfony/dependency-injection' => ['Tests'],
'symfony/dom-crawler' => ['Tests'],
// @see \Drupal\Tests\Component\EventDispatcher\ContainerAwareEventDispatcherTest
// 'symfony/event-dispatcher' => ['Tests'],
'symfony/http-foundation' => ['Tests'],
'symfony/http-kernel' => ['Tests'],
'symfony/process' => ['Tests'],
'symfony/psr-http-message-bridge' => ['Tests'],
'symfony/routing' => ['Tests'],
'symfony/serializer' => ['Tests'],
'symfony/translation' => ['Tests'],
'symfony/validator' => ['Tests'],
'symfony/yaml' => ['Tests'],
'symfony-cmf/routing' => ['Test', 'Tests'],
'twig/twig' => ['doc', 'ext', 'test'],
];
/** /**
* Add vendor classes to composers static classmap. * Add vendor classes to composers static classmap.
*/ */
@ -70,4 +121,90 @@ EOT;
} }
} }
/**
* Remove possibly problematic test files from vendored projects.
*
* @param \Composer\Script\Event $event
*/
public static function vendorTestCodeCleanup(PackageEvent $event) {
$vendor_dir = $event->getComposer()->getConfig()->get('vendor-dir');
$op = $event->getOperation();
if ($op->getJobType() == 'update') {
$package = $op->getTargetPackage();
}
else {
$package = $op->getPackage();
}
$package_key = static::findPackageKey($package->getName());
if ($package_key) {
foreach (static::$packageToCleanup[$package_key] as $path) {
$dir_to_remove = $vendor_dir . '/' . $package_key . '/' . $path;
if (is_dir($dir_to_remove)) {
if (!static::deleteRecursive($dir_to_remove)) {
throw new \RuntimeException(sprintf("Failure removing directory '%s' in package '%s'.", $path, $package->getPrettyName()));
}
}
else {
throw new \RuntimeException(sprintf("The directory '%s' in package '%s' does not exist.", $path, $package->getPrettyName()));
}
}
}
}
/**
* Find the array key for a given package name with a case-insensitive search.
*
* @param string $package_name
* The package name from composer. This is always already lower case.
*
* @return NULL|string
* The string key, or NULL if none was found.
*/
protected static function findPackageKey($package_name) {
$package_key = NULL;
// In most cases the package name is already used as the array key.
if (isset(static::$packageToCleanup[$package_name])) {
$package_key = $package_name;
}
else {
// Handle any mismatch in case between the package name and array key.
// For example, the array key 'mikey179/vfsStream' needs to be found
// when composer returns a package name of 'mikey179/vfsstream'.
foreach (static::$packageToCleanup as $key => $dirs) {
if (strtolower($key) === $package_name) {
$package_key = $key;
break;
}
}
}
return $package_key;
}
/**
* Helper method to remove directories and the files they contain.
*
* @param string $path
* The directory or file to remove. It must exist.
*
* @return bool
* TRUE on success or FALSE on failure.
*/
protected static function deleteRecursive($path) {
if (is_file($path) || is_link($path)) {
return unlink($path);
}
$success = TRUE;
$dir = dir($path);
while (($entry = $dir->read()) !== FALSE) {
if ($entry == '.' || $entry == '..') {
continue;
}
$entry_path = $path . '/' . $entry;
$success = static::deleteRecursive($entry_path) && $success;
}
$dir->close();
return rmdir($path) && $success;
}
} }

View file

@ -7,8 +7,6 @@
namespace Drupal\Core\Condition; namespace Drupal\Core\Condition;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Executable\ExecutableManagerInterface; use Drupal\Core\Executable\ExecutableManagerInterface;
use Drupal\Core\Executable\ExecutablePluginBase; use Drupal\Core\Executable\ExecutablePluginBase;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;

View file

@ -7,7 +7,6 @@
namespace Drupal\Core\Config; namespace Drupal\Core\Config;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\DependencyInjection\DependencySerializationTrait; use Drupal\Core\DependencyInjection\DependencySerializationTrait;

View file

@ -10,7 +10,6 @@ namespace Drupal\Core\Config;
use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Unicode;
use Drupal\Core\Config\Entity\ConfigDependencyManager; use Drupal\Core\Config\Entity\ConfigDependencyManager;
use Drupal\Core\Config\Entity\ConfigEntityDependency; use Drupal\Core\Config\Entity\ConfigEntityDependency;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface;

View file

@ -9,14 +9,12 @@ namespace Drupal\Core\Config\Entity;
use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\Cache;
use Drupal\Core\Config\ConfigException;
use Drupal\Core\Config\Schema\SchemaIncompleteException; use Drupal\Core\Config\Schema\SchemaIncompleteException;
use Drupal\Core\Entity\Entity; use Drupal\Core\Entity\Entity;
use Drupal\Core\Config\ConfigDuplicateUUIDException; use Drupal\Core\Config\ConfigDuplicateUUIDException;
use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityWithPluginCollectionInterface; use Drupal\Core\Entity\EntityWithPluginCollectionInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Plugin\PluginDependencyTrait; use Drupal\Core\Plugin\PluginDependencyTrait;
/** /**

View file

@ -7,7 +7,6 @@
namespace Drupal\Core\Config\Entity; namespace Drupal\Core\Config\Entity;
use Drupal\Core\Config\Config;
use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityStorageInterface;
/** /**

View file

@ -27,7 +27,7 @@ class Condition extends ConditionBase {
$single_conditions = array(); $single_conditions = array();
$condition_groups = array(); $condition_groups = array();
foreach ($this->conditions as $condition) { foreach ($this->conditions as $condition) {
if ($condition['field'] instanceOf ConditionInterface) { if ($condition['field'] instanceof ConditionInterface) {
$condition_groups[] = $condition; $condition_groups[] = $condition;
} }
else { else {

View file

@ -109,7 +109,7 @@ interface StorageComparerInterface {
* *
* @return array * @return array
* An associative array of configuration names. The array keys are * An associative array of configuration names. The array keys are
* 'old_name' and and 'new_name' representing the old and name configuration * 'old_name' and 'new_name' representing the old and new configuration
* object names during a rename operation. * object names during a rename operation.
* *
* @see \Drupal\Core\Config\StorageComparer::createRenameNames() * @see \Drupal\Core\Config\StorageComparer::createRenameNames()

View file

@ -43,14 +43,24 @@ class ConfigSchemaChecker implements EventSubscriberInterface {
*/ */
protected $checked = array(); protected $checked = array();
/**
* An array of config object names that are excluded from schema checking.
*
* @var string[]
*/
protected $exclude = array();
/** /**
* Constructs the ConfigSchemaChecker object. * Constructs the ConfigSchemaChecker object.
* *
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_manager * @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_manager
* The typed config manager. * The typed config manager.
* @param string[] $exclude
* An array of config object names that are excluded from schema checking.
*/ */
public function __construct(TypedConfigManagerInterface $typed_manager) { public function __construct(TypedConfigManagerInterface $typed_manager, array $exclude = array()) {
$this->typedManager = $typed_manager; $this->typedManager = $typed_manager;
$this->exclude = $exclude;
} }
/** /**
@ -74,17 +84,7 @@ class ConfigSchemaChecker implements EventSubscriberInterface {
$name = $saved_config->getName(); $name = $saved_config->getName();
$data = $saved_config->get(); $data = $saved_config->get();
$checksum = hash('crc32b', serialize($data)); $checksum = hash('crc32b', serialize($data));
$exceptions = array( if (!in_array($name, $this->exclude) && !isset($this->checked[$name . ':' . $checksum])) {
// Following are used to test lack of or partial schema. Where partial
// schema is provided, that is explicitly tested in specific tests.
'config_schema_test.noschema',
'config_schema_test.someschema',
'config_schema_test.schema_data_types',
'config_schema_test.no_schema_data_types',
// Used to test application of schema to filtering of configuration.
'config_test.dynamic.system',
);
if (!in_array($name, $exceptions) && !isset($this->checked[$name . ':' . $checksum])) {
$this->checked[$name . ':' . $checksum] = TRUE; $this->checked[$name . ':' . $checksum] = TRUE;
$errors = $this->checkConfigSchema($this->typedManager, $name, $data); $errors = $this->checkConfigSchema($this->typedManager, $name, $data);
if ($errors === FALSE) { if ($errors === FALSE) {

View file

@ -9,7 +9,6 @@ namespace Drupal\Core\Config;
use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Config\Schema\ArrayElement;
use Drupal\Core\Config\Schema\ConfigSchemaAlterException; use Drupal\Core\Config\Schema\ConfigSchemaAlterException;
use Drupal\Core\Config\Schema\ConfigSchemaDiscovery; use Drupal\Core\Config\Schema\ConfigSchemaDiscovery;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;

View file

@ -7,7 +7,6 @@
namespace Drupal\Core\Database\Driver\mysql; namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Query\Condition; use Drupal\Core\Database\Query\Condition;
use Drupal\Core\Database\SchemaException; use Drupal\Core\Database\SchemaException;
use Drupal\Core\Database\SchemaObjectExistsException; use Drupal\Core\Database\SchemaObjectExistsException;

View file

@ -10,9 +10,6 @@ namespace Drupal\Core\Database\Driver\pgsql;
use Drupal\Core\Database\Database; use Drupal\Core\Database\Database;
use Drupal\Core\Database\Connection as DatabaseConnection; use Drupal\Core\Database\Connection as DatabaseConnection;
use Drupal\Core\Database\DatabaseNotFoundException; use Drupal\Core\Database\DatabaseNotFoundException;
use Drupal\Core\Database\StatementInterface;
use Drupal\Core\Database\IntegrityConstraintViolationException;
use Drupal\Core\Database\DatabaseExceptionWrapper;
/** /**
* @addtogroup database * @addtogroup database

View file

@ -8,8 +8,6 @@
namespace Drupal\Core\Database\Driver\pgsql; namespace Drupal\Core\Database\Driver\pgsql;
use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Unicode;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Query\Condition;
use Drupal\Core\Database\SchemaObjectExistsException; use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\SchemaObjectDoesNotExistException; use Drupal\Core\Database\SchemaObjectDoesNotExistException;
use Drupal\Core\Database\Schema as DatabaseSchema; use Drupal\Core\Database\Schema as DatabaseSchema;

View file

@ -277,10 +277,10 @@ class Condition implements ConditionInterface, \Countable {
$this->changed = TRUE; $this->changed = TRUE;
foreach ($this->conditions as $key => $condition) { foreach ($this->conditions as $key => $condition) {
if ($key !== '#conjunction') { if ($key !== '#conjunction') {
if ($condition['field'] instanceOf ConditionInterface) { if ($condition['field'] instanceof ConditionInterface) {
$this->conditions[$key]['field'] = clone($condition['field']); $this->conditions[$key]['field'] = clone($condition['field']);
} }
if ($condition['value'] instanceOf SelectInterface) { if ($condition['value'] instanceof SelectInterface) {
$this->conditions[$key]['value'] = clone($condition['value']); $this->conditions[$key]['value'] = clone($condition['value']);
} }
} }

View file

@ -8,8 +8,6 @@
namespace Drupal\Core\Database\Query; namespace Drupal\Core\Database\Query;
use Drupal\Core\Database\Connection; use Drupal\Core\Database\Connection;
use Drupal\Core\Database\Query\SelectExtender;
use Drupal\Core\Database\Query\SelectInterface;
/** /**
* Query extender for pager queries. * Query extender for pager queries.

View file

@ -7,7 +7,6 @@
namespace Drupal\Core\Database; namespace Drupal\Core\Database;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\Query\Condition; use Drupal\Core\Database\Query\Condition;
use Drupal\Core\Database\Query\PlaceholderInterface; use Drupal\Core\Database\Query\PlaceholderInterface;

View file

@ -8,7 +8,6 @@
namespace Drupal\Core\Datetime; namespace Drupal\Core\Datetime;
use Drupal\Core\Config\Entity\ConfigEntityInterface; use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\Core\Datetime\DrupalDateTime;
/** /**
* Provides an interface defining a date format. * Provides an interface defining a date format.

View file

@ -8,7 +8,6 @@
namespace Drupal\Core\Datetime; namespace Drupal\Core\Datetime;
use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Language\Language; use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Language\LanguageManagerInterface;

View file

@ -16,8 +16,6 @@
*/ */
namespace Drupal\Core\Datetime; namespace Drupal\Core\Datetime;
use Drupal\Core\Datetime\DrupalDateTime;
/** /**
* Defines Gregorian Calendar date values. * Defines Gregorian Calendar date values.
*/ */
@ -449,7 +447,7 @@ class DateHelper {
* The number of days in the month. * The number of days in the month.
*/ */
public static function daysInMonth($date = NULL) { public static function daysInMonth($date = NULL) {
if (!$date instanceOf DrupalDateTime) { if (!$date instanceof DrupalDateTime) {
$date = new DrupalDateTime($date); $date = new DrupalDateTime($date);
} }
if (!$date->hasErrors()) { if (!$date->hasErrors()) {
@ -469,7 +467,7 @@ class DateHelper {
* The number of days in the year. * The number of days in the year.
*/ */
public static function daysInYear($date = NULL) { public static function daysInYear($date = NULL) {
if (!$date instanceOf DrupalDateTime) { if (!$date instanceof DrupalDateTime) {
$date = new DrupalDateTime($date); $date = new DrupalDateTime($date);
} }
if (!$date->hasErrors()) { if (!$date->hasErrors()) {
@ -494,7 +492,7 @@ class DateHelper {
* The number of the day in the week. * The number of the day in the week.
*/ */
public static function dayOfWeek($date = NULL) { public static function dayOfWeek($date = NULL) {
if (!$date instanceOf DrupalDateTime) { if (!$date instanceof DrupalDateTime) {
$date = new DrupalDateTime($date); $date = new DrupalDateTime($date);
} }
if (!$date->hasErrors()) { if (!$date->hasErrors()) {
@ -517,7 +515,7 @@ class DateHelper {
* The name of the day in the week for that date. * The name of the day in the week for that date.
*/ */
public static function dayOfWeekName($date = NULL, $abbr = TRUE) { public static function dayOfWeekName($date = NULL, $abbr = TRUE) {
if (!$date instanceOf DrupalDateTime) { if (!$date instanceof DrupalDateTime) {
$date = new DrupalDateTime($date); $date = new DrupalDateTime($date);
} }
$dow = self::dayOfWeek($date); $dow = self::dayOfWeek($date);

View file

@ -66,7 +66,7 @@ abstract class DateElementBase extends FormElement {
$min_year = $temp; $min_year = $temp;
} }
// If there is a current value, stretch the range to include it. // If there is a current value, stretch the range to include it.
$value_year = $date instanceOf DrupalDateTime ? $date->format('Y') : ''; $value_year = $date instanceof DrupalDateTime ? $date->format('Y') : '';
if (!empty($value_year)) { if (!empty($value_year)) {
$min_year = min($value_year, $min_year); $min_year = min($value_year, $min_year);
$max_year = max($value_year, $max_year); $max_year = max($value_year, $max_year);

View file

@ -67,7 +67,7 @@ class Datelist extends DateElementBase {
} }
$timezone = !empty($element['#date_timezone']) ? $element['#date_timezone'] : NULL; $timezone = !empty($element['#date_timezone']) ? $element['#date_timezone'] : NULL;
$date = DrupalDateTime::createFromArray($input, $timezone); $date = DrupalDateTime::createFromArray($input, $timezone);
if ($date instanceOf DrupalDateTime && !$date->hasErrors()) { if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
static::incrementRound($date, $increment); static::incrementRound($date, $increment);
} }
} }
@ -76,7 +76,7 @@ class Datelist extends DateElementBase {
$return = array_fill_keys($parts, ''); $return = array_fill_keys($parts, '');
if (!empty($element['#default_value'])) { if (!empty($element['#default_value'])) {
$date = $element['#default_value']; $date = $element['#default_value'];
if ($date instanceOf DrupalDateTime && !$date->hasErrors()) { if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
static::incrementRound($date, $increment); static::incrementRound($date, $increment);
foreach ($parts as $part) { foreach ($parts as $part) {
switch ($part) { switch ($part) {
@ -184,7 +184,7 @@ class Datelist extends DateElementBase {
$date = !empty($element['#value']['object']) ? $element['#value']['object'] : NULL; $date = !empty($element['#value']['object']) ? $element['#value']['object'] : NULL;
// Set a fallback timezone. // Set a fallback timezone.
if ($date instanceOf DrupalDateTime) { if ($date instanceof DrupalDateTime) {
$element['#date_timezone'] = $date->getTimezone()->getName(); $element['#date_timezone'] = $date->getTimezone()->getName();
} }
elseif (!empty($element['#timezone'])) { elseif (!empty($element['#timezone'])) {
@ -253,7 +253,7 @@ class Datelist extends DateElementBase {
} }
$default = isset($element['#value'][$part]) && trim($element['#value'][$part]) != '' ? $element['#value'][$part] : ''; $default = isset($element['#value'][$part]) && trim($element['#value'][$part]) != '' ? $element['#value'][$part] : '';
$value = $date instanceOf DrupalDateTime && !$date->hasErrors() ? $date->format($format) : $default; $value = $date instanceof DrupalDateTime && !$date->hasErrors() ? $date->format($format) : $default;
if (!empty($value) && $part != 'ampm') { if (!empty($value) && $part != 'ampm') {
$value = intval($value); $value = intval($value);
} }
@ -320,7 +320,7 @@ class Datelist extends DateElementBase {
else { else {
// If the input is valid, set it. // If the input is valid, set it.
$date = $input['object']; $date = $input['object'];
if ($date instanceOf DrupalDateTime && !$date->hasErrors()) { if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
$form_state->setValueForElement($element, $date); $form_state->setValueForElement($element, $date);
} }
// If the input is invalid, set an error. // If the input is invalid, set an error.
@ -364,7 +364,7 @@ class Datelist extends DateElementBase {
*/ */
protected static function incrementRound(&$date, $increment) { protected static function incrementRound(&$date, $increment) {
// Round minutes and seconds, if necessary. // Round minutes and seconds, if necessary.
if ($date instanceOf DrupalDateTime && $increment > 1) { if ($date instanceof DrupalDateTime && $increment > 1) {
$day = intval($date->format('j')); $day = intval($date->format('j'));
$hour = intval($date->format('H')); $hour = intval($date->format('H'));
$second = intval(round(intval($date->format('s')) / $increment) * $increment); $second = intval(round(intval($date->format('s')) / $increment) * $increment);

View file

@ -101,7 +101,7 @@ class Datetime extends DateElementBase {
} }
else { else {
$date = $element['#default_value']; $date = $element['#default_value'];
if ($date instanceOf DrupalDateTime && !$date->hasErrors()) { if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
$input = array( $input = array(
'date' => $date->format($element['#date_date_format']), 'date' => $date->format($element['#date_date_format']),
'time' => $date->format($element['#date_time_format']), 'time' => $date->format($element['#date_time_format']),
@ -223,7 +223,7 @@ class Datetime extends DateElementBase {
$date = !empty($element['#value']['object']) ? $element['#value']['object'] : NULL; $date = !empty($element['#value']['object']) ? $element['#value']['object'] : NULL;
// Set a fallback timezone. // Set a fallback timezone.
if ($date instanceOf DrupalDateTime) { if ($date instanceof DrupalDateTime) {
$element['#date_timezone'] = $date->getTimezone()->getName(); $element['#date_timezone'] = $date->getTimezone()->getName();
} }
elseif (empty($element['#timezone'])) { elseif (empty($element['#timezone'])) {
@ -246,7 +246,7 @@ class Datetime extends DateElementBase {
); );
// Adds the HTML5 date attributes. // Adds the HTML5 date attributes.
if ($date instanceOf DrupalDateTime && !$date->hasErrors()) { if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
$html5_min = clone($date); $html5_min = clone($date);
$range = static::datetimeRangeYears($element['#date_year_range'], $date); $range = static::datetimeRangeYears($element['#date_year_range'], $date);
$html5_min->setDate($range[0], 1, 1)->setTime(0, 0, 0); $html5_min->setDate($range[0], 1, 1)->setTime(0, 0, 0);

View file

@ -10,8 +10,6 @@ namespace Drupal\Core\DependencyInjection\Compiler;
use Drupal\Component\ProxyBuilder\ProxyBuilder; use Drupal\Component\ProxyBuilder\ProxyBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
/** /**

View file

@ -7,10 +7,8 @@
namespace Drupal\Core\DependencyInjection\Compiler; namespace Drupal\Core\DependencyInjection\Compiler;
use Drupal\Core\StreamWrapper\StreamWrapperInterface;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
/** /**
* Adds services tagged 'stream_wrapper' to the stream_wrapper_manager service. * Adds services tagged 'stream_wrapper' to the stream_wrapper_manager service.

View file

@ -22,14 +22,12 @@ use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\File\MimeType\MimeTypeGuesser; use Drupal\Core\File\MimeType\MimeTypeGuesser;
use Drupal\Core\Http\TrustedHostsRequestFactory; use Drupal\Core\Http\TrustedHostsRequestFactory;
use Drupal\Core\Language\Language; use Drupal\Core\Language\Language;
use Drupal\Core\PageCache\RequestPolicyInterface;
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;

View file

@ -0,0 +1,143 @@
<?php
/**
* @file
* Contains \Drupal\Core\Entity\Controller\EntityController.
*/
namespace Drupal\Core\Entity\Controller;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides generic entity title callbacks for use in routing.
*
* It provides:
* - A view title callback.
* - An edit title callback.
* - A delete title callback.
*/
class EntityController implements ContainerInjectionInterface {
use StringTranslationTrait;
/**
* The entity manager.
*
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
/**
* Constructs a new EntityController.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
* The string translation.
*/
public function __construct(EntityManagerInterface $entity_manager, TranslationInterface $string_translation) {
$this->entityManager = $entity_manager;
$this->stringTranslation = $string_translation;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.manager'),
$container->get('string_translation')
);
}
/**
* Provides a generic title callback for a single entity.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match.
* @param \Drupal\Core\Entity\EntityInterface $_entity
* (optional) An entity, passed in directly from the request attributes.
*
* @return string
* The title for the entity view page.
*/
public function title(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) {
if ($entity = $this->doGetEntity($route_match, $_entity)) {
return $entity->label();
}
}
/**
* Provides a generic edit title callback.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match.
* @param \Drupal\Core\Entity\EntityInterface $_entity
* (optional) An entity, passed in directly from the request attributes.
*
* @return string
* The title for the entity edit page.
*/
public function editTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) {
if ($entity = $this->doGetEntity($route_match, $_entity)) {
return $this->t('Edit %label', ['%label' => $entity->label()]);
}
}
/**
* Provides a generic delete title callback.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match.
* @param \Drupal\Core\Entity\EntityInterface $_entity
* (optional) An entity, passed in directly from the request attributes, and
* set in \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer.
*
* @return string
* The title for the delete entity page.
*/
public function deleteTitle(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) {
if ($entity = $this->doGetEntity($route_match, $_entity)) {
return $this->t('Delete %label', ['%label' => $entity->label()]);
}
}
/**
* Determines the entity.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match.
* @param \Drupal\Core\Entity\EntityInterface $_entity
* (optional) The entity, set in
* \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer.
*
* @return \Drupal\Core\Entity\EntityInterface|NULL
* The entity, if it is passed in directly or if the first parameter of the
* active route is an entity; otherwise, NULL.
*/
protected function doGetEntity(RouteMatchInterface $route_match, EntityInterface $_entity = NULL) {
if ($_entity) {
$entity = $_entity;
}
else {
// Let's look up in the route object for the name of upcasted values.
foreach ($route_match->getParameters() as $parameter) {
if ($parameter instanceof EntityInterface) {
$entity = $parameter;
break;
}
}
}
if ($entity) {
return $this->entityManager->getTranslationFromContext($entity);
}
}
}

View file

@ -8,7 +8,6 @@
namespace Drupal\Core\Entity\Controller; namespace Drupal\Core\Entity\Controller;
use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Defines a generic controller to list entities. * Defines a generic controller to list entities.

View file

@ -10,7 +10,6 @@ namespace Drupal\Core\Entity;
use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\RefinableCacheableDependencyTrait; use Drupal\Core\Cache\RefinableCacheableDependencyTrait;
use Drupal\Core\DependencyInjection\DependencySerializationTrait; use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Unicode;
use Drupal\Core\Config\Entity\Exception\ConfigEntityIdLengthException; use Drupal\Core\Config\Entity\Exception\ConfigEntityIdLengthException;
use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException; use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException;

View file

@ -10,7 +10,6 @@ namespace Drupal\Core\Entity;
use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
/** /**

View file

@ -10,7 +10,6 @@ namespace Drupal\Core\Entity;
use Drupal\Core\Form\ConfirmFormHelper; use Drupal\Core\Form\ConfirmFormHelper;
use Drupal\Core\Form\ConfirmFormInterface; use Drupal\Core\Form\ConfirmFormInterface;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\HttpFoundation\Request;
/** /**
* Provides a generic base class for an entity-based confirmation form. * Provides a generic base class for an entity-based confirmation form.

View file

@ -7,7 +7,6 @@
namespace Drupal\Core\Entity; namespace Drupal\Core\Entity;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**

View file

@ -24,7 +24,6 @@ use Drupal\Core\Field\FieldStorageDefinitionEvents;
use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionListenerInterface; use Drupal\Core\Field\FieldStorageDefinitionListenerInterface;
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface; use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Core\Plugin\DefaultPluginManager;
@ -1133,7 +1132,7 @@ class EntityManager extends DefaultPluginManager implements EntityManagerInterfa
} }
/** /**
* Returns an array of display mode options by bundle. * Returns an array of enabled display mode options by bundle.
* *
* @param $display_type * @param $display_type
* The display type to be retrieved. It can be "view_mode" or "form_mode". * The display type to be retrieved. It can be "view_mode" or "form_mode".

View file

@ -450,7 +450,7 @@ interface EntityManagerInterface extends PluginManagerInterface, EntityTypeListe
public function getFormModeOptions($entity_type_id); public function getFormModeOptions($entity_type_id);
/** /**
* Returns an array of view mode options by bundle. * Returns an array of enabled view mode options by bundle.
* *
* @param string $entity_type_id * @param string $entity_type_id
* The entity type whose view mode options should be returned. * The entity type whose view mode options should be returned.
@ -463,7 +463,7 @@ interface EntityManagerInterface extends PluginManagerInterface, EntityTypeListe
public function getViewModeOptionsByBundle($entity_type_id, $bundle); public function getViewModeOptionsByBundle($entity_type_id, $bundle);
/** /**
* Returns an array of form mode options by bundle. * Returns an array of enabled form mode options by bundle.
* *
* @param string $entity_type_id * @param string $entity_type_id
* The entity type whose form mode options should be returned. * The entity type whose form mode options should be returned.

View file

@ -87,7 +87,7 @@ abstract class ConditionFundamentals {
*/ */
public function __clone() { public function __clone() {
foreach ($this->conditions as $key => $condition) { foreach ($this->conditions as $key => $condition) {
if ($condition['field'] instanceOf ConditionInterface) { if ($condition['field'] instanceof ConditionInterface) {
$this->conditions[$key]['field'] = clone($condition['field']); $this->conditions[$key]['field'] = clone($condition['field']);
} }
} }

View file

@ -37,7 +37,7 @@ class Condition extends ConditionBase {
$sql_query = $conditionContainer instanceof SelectInterface ? $conditionContainer : $conditionContainer->sqlQuery; $sql_query = $conditionContainer instanceof SelectInterface ? $conditionContainer : $conditionContainer->sqlQuery;
$tables = $this->query->getTables($sql_query); $tables = $this->query->getTables($sql_query);
foreach ($this->conditions as $condition) { foreach ($this->conditions as $condition) {
if ($condition['field'] instanceOf ConditionInterface) { if ($condition['field'] instanceof ConditionInterface) {
$sql_condition = new SqlCondition($condition['field']->getConjunction()); $sql_condition = new SqlCondition($condition['field']->getConjunction());
// Add the SQL query to the object before calling this method again. // Add the SQL query to the object before calling this method again.
$sql_condition->sqlQuery = $sql_query; $sql_condition->sqlQuery = $sql_query;

View file

@ -30,7 +30,7 @@ class ConditionAggregate extends ConditionAggregateBase {
$sql_query = ($conditionContainer instanceof SelectInterface) ? $conditionContainer : $conditionContainer->sqlQuery; $sql_query = ($conditionContainer instanceof SelectInterface) ? $conditionContainer : $conditionContainer->sqlQuery;
$tables = new Tables($sql_query); $tables = new Tables($sql_query);
foreach ($this->conditions as $condition) { foreach ($this->conditions as $condition) {
if ($condition['field'] instanceOf ConditionAggregateInterface) { if ($condition['field'] instanceof ConditionAggregateInterface) {
$sql_condition = new SqlCondition($condition['field']->getConjunction()); $sql_condition = new SqlCondition($condition['field']->getConjunction());
// Add the SQL query to the object before calling this method again. // Add the SQL query to the object before calling this method again.
$sql_condition->sqlQuery = $sql_query; $sql_condition->sqlQuery = $sql_query;

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