Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023

This commit is contained in:
Pantheon Automation 2015-09-04 13:20:09 -07:00 committed by Greg Anderson
parent 2720a9ec4b
commit f3791f1da3
1898 changed files with 54300 additions and 11481 deletions

View file

@ -0,0 +1,37 @@
<?php
/**
* @file
* Contains \Drupal\Core\DependencyInjection\Compiler\TwigExtensionPass.
*/
namespace Drupal\Core\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Adds the twig_extension_hash parameter to the container.
*
* twig_extension_hash is a hash of all extension mtimes for Twig template
* invalidation.
*/
class TwigExtensionPass implements CompilerPassInterface {
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container) {
$twig_extension_hash = '';
foreach (array_keys($container->findTaggedServiceIds('twig.extension')) as $service_id) {
$class_name = $container->getDefinition($service_id)->getClass();
$reflection = new \ReflectionClass($class_name);
// We use the class names as hash in order to invalidate on new extensions
// and mtime for every time we change an existing file.
$twig_extension_hash .= $class_name . filemtime($reflection->getFileName());
}
$container->setParameter('twig_extension_hash', hash('crc32b', $twig_extension_hash));
}
}

View file

@ -7,17 +7,18 @@
namespace Drupal\Core\DependencyInjection;
use Symfony\Component\DependencyInjection\Container as SymfonyContainer;
use Drupal\Component\DependencyInjection\Container as DrupalContainer;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Extends the symfony container to set the service ID on the created object.
* Extends the Drupal container to set the service ID on the created object.
*/
class Container extends SymfonyContainer {
class Container extends DrupalContainer {
/**
* {@inheritdoc}
*/
public function set($id, $service, $scope = SymfonyContainer::SCOPE_CONTAINER) {
public function set($id, $service, $scope = ContainerInterface::SCOPE_CONTAINER) {
parent::set($id, $service, $scope);
// Ensure that the _serviceId property is set on synthetic services as well.
@ -30,7 +31,7 @@ class Container extends SymfonyContainer {
* {@inheritdoc}
*/
public function __sleep() {
trigger_error('The container was serialized.', E_USER_ERROR);
assert(FALSE, 'The container was serialized.');
return array_keys(get_object_vars($this));
}

View file

@ -118,7 +118,7 @@ class ContainerBuilder extends SymfonyContainerBuilder {
* {@inheritdoc}
*/
public function __sleep() {
trigger_error('The container was serialized.', E_USER_ERROR);
assert(FALSE, 'The container was serialized.');
return array_keys(get_object_vars($this));
}