Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/rest/src/Routing/ResourceRoutes.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
24 protected $manager; | 24 protected $manager; |
25 | 25 |
26 /** | 26 /** |
27 * The REST resource config storage. | 27 * The REST resource config storage. |
28 * | 28 * |
29 * @var \Drupal\Core\Entity\EntityManagerInterface | 29 * @var \Drupal\Core\Entity\EntityStorageInterface |
30 */ | 30 */ |
31 protected $resourceConfigStorage; | 31 protected $resourceConfigStorage; |
32 | 32 |
33 /** | 33 /** |
34 * A logger instance. | 34 * A logger instance. |
99 if (($methods && ($method = $methods[0]) && $supported_formats = $rest_resource_config->getFormats($method)) || $route->hasOption('bc_route')) { | 99 if (($methods && ($method = $methods[0]) && $supported_formats = $rest_resource_config->getFormats($method)) || $route->hasOption('bc_route')) { |
100 $route->setRequirement('_csrf_request_header_token', 'TRUE'); | 100 $route->setRequirement('_csrf_request_header_token', 'TRUE'); |
101 | 101 |
102 // Check that authentication providers are defined. | 102 // Check that authentication providers are defined. |
103 if (empty($rest_resource_config->getAuthenticationProviders($method))) { | 103 if (empty($rest_resource_config->getAuthenticationProviders($method))) { |
104 $this->logger->error('At least one authentication provider must be defined for resource @id', [':id' => $rest_resource_config->id()]); | 104 $this->logger->error('At least one authentication provider must be defined for resource @id', ['@id' => $rest_resource_config->id()]); |
105 continue; | 105 continue; |
106 } | 106 } |
107 | 107 |
108 // Check that formats are defined. | 108 // Check that formats are defined. |
109 if (empty($rest_resource_config->getFormats($method))) { | 109 if (empty($rest_resource_config->getFormats($method))) { |
110 $this->logger->error('At least one format must be defined for resource @id', [':id' => $rest_resource_config->id()]); | 110 $this->logger->error('At least one format must be defined for resource @id', ['@id' => $rest_resource_config->id()]); |
111 continue; | 111 continue; |
112 } | 112 } |
113 | 113 |
114 // Remove BC routes for unsupported formats. | 114 // Remove BC routes for unsupported formats. |
115 if ($route->getOption('bc_route') === TRUE) { | 115 if ($route->getOption('bc_route') === TRUE) { |