Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -93,8 +93,9 @@ class XmlFileLoader extends FileLoader
|
|||
return;
|
||||
}
|
||||
|
||||
$defaultDirectory = dirname($file);
|
||||
foreach ($imports as $import) {
|
||||
$this->setCurrentDir(dirname($file));
|
||||
$this->setCurrentDir($defaultDirectory);
|
||||
$this->import($import->getAttribute('resource'), null, (bool) XmlUtils::phpize($import->getAttribute('ignore-errors')), $file);
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +148,7 @@ class XmlFileLoader extends FileLoader
|
|||
$definition = new Definition();
|
||||
}
|
||||
|
||||
foreach (array('class', 'scope', 'public', 'factory-class', 'factory-method', 'factory-service', 'synthetic', 'lazy', 'abstract') as $key) {
|
||||
foreach (array('class', 'shared', 'public', 'factory-class', 'factory-method', 'factory-service', 'synthetic', 'lazy', 'abstract') as $key) {
|
||||
if ($value = $service->getAttribute($key)) {
|
||||
if (in_array($key, array('factory-class', 'factory-method', 'factory-service'))) {
|
||||
@trigger_error(sprintf('The "%s" attribute of service "%s" in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use the "factory" element instead.', $key, (string) $service->getAttribute('id'), $file), E_USER_DEPRECATED);
|
||||
|
@ -157,6 +158,20 @@ class XmlFileLoader extends FileLoader
|
|||
}
|
||||
}
|
||||
|
||||
if ($value = $service->getAttribute('autowire')) {
|
||||
$definition->setAutowired(XmlUtils::phpize($value));
|
||||
}
|
||||
|
||||
if ($value = $service->getAttribute('scope')) {
|
||||
$triggerDeprecation = 'request' !== (string) $service->getAttribute('id');
|
||||
|
||||
if ($triggerDeprecation) {
|
||||
@trigger_error(sprintf('The "scope" attribute of service "%s" in file "%s" is deprecated since version 2.8 and will be removed in 3.0.', (string) $service->getAttribute('id'), $file), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$definition->setScope(XmlUtils::phpize($value), false);
|
||||
}
|
||||
|
||||
if ($value = $service->getAttribute('synchronized')) {
|
||||
$triggerDeprecation = 'request' !== (string) $service->getAttribute('id');
|
||||
|
||||
|
@ -171,6 +186,10 @@ class XmlFileLoader extends FileLoader
|
|||
$definition->setFile($files[0]->nodeValue);
|
||||
}
|
||||
|
||||
if ($deprecated = $this->getChildren($service, 'deprecated')) {
|
||||
$definition->setDeprecated(true, $deprecated[0]->nodeValue);
|
||||
}
|
||||
|
||||
$definition->setArguments($this->getArgumentsAsPhp($service, 'argument'));
|
||||
$definition->setProperties($this->getArgumentsAsPhp($service, 'property'));
|
||||
|
||||
|
@ -230,12 +249,21 @@ class XmlFileLoader extends FileLoader
|
|||
$parameters[$name] = XmlUtils::phpize($node->nodeValue);
|
||||
}
|
||||
|
||||
if ('' === $tag->getAttribute('name')) {
|
||||
throw new InvalidArgumentException(sprintf('The tag name for service "%s" in %s must be a non-empty string.', (string) $service->getAttribute('id'), $file));
|
||||
}
|
||||
|
||||
$definition->addTag($tag->getAttribute('name'), $parameters);
|
||||
}
|
||||
|
||||
foreach ($this->getChildren($service, 'autowiring-type') as $type) {
|
||||
$definition->addAutowiringType($type->textContent);
|
||||
}
|
||||
|
||||
if ($value = $service->getAttribute('decorates')) {
|
||||
$renameId = $service->hasAttribute('decoration-inner-name') ? $service->getAttribute('decoration-inner-name') : null;
|
||||
$definition->setDecoratedService($value, $renameId);
|
||||
$priority = $service->hasAttribute('decoration-priority') ? $service->getAttribute('decoration-priority') : 0;
|
||||
$definition->setDecoratedService($value, $renameId, $priority);
|
||||
}
|
||||
|
||||
return $definition;
|
||||
|
|
Reference in a new issue