diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php b/core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php index 1136376..6edea17 100644 --- a/core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php +++ b/core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php @@ -7,10 +7,12 @@ namespace Drupal\rest\Plugin\Type; -use Drupal\Component\Plugin\PluginManagerBase; use Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator; -use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery; use Drupal\Component\Plugin\Factory\ReflectionFactory; +use Drupal\Component\Plugin\PluginManagerBase; +use Drupal\Core\Plugin\Discovery\AlterDecorator; +use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery; +use Drupal\Core\Plugin\Discovery\CacheDecorator; /** * Manages discovery and instantiation of resource plugins. @@ -26,7 +28,11 @@ class ResourcePluginManager extends PluginManagerBase { */ public function __construct(\Traversable $namespaces) { // Create resource plugin derivatives from declaratively defined resources. - $this->discovery = new DerivativeDiscoveryDecorator(new AnnotatedClassDiscovery('rest/resource', $namespaces)); + $this->discovery = new AnnotatedClassDiscovery('rest/resource', $namespaces); + $this->discovery = new DerivativeDiscoveryDecorator($this->discovery); + $this->discovery = new AlterDecorator($this->discovery, 'rest_resource'); + $this->discovery = new CacheDecorator($this->discovery, 'rest'); + $this->factory = new ReflectionFactory($this->discovery); } diff --git a/core/modules/rest/rest.api.php b/core/modules/rest/rest.api.php new file mode 100644 index 0000000..0e94098 --- /dev/null +++ b/core/modules/rest/rest.api.php @@ -0,0 +1,33 @@ +