Updated: Comment #0

Problem/Motivation

Sometimes there's not enough to search in the top discovery directory for annotated plugins.

Here's a case:

core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/GDResize.php
core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/GDRotate.php
etc.

should live on

core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/gd/Resize.php
core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/gd/Rotate.php
etc. but also...
core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/Operation/imagemagick/Resize.php

But this is not possible now because we search only in $subdir of AnnotatedClassDiscovery.

Proposed resolution

Allow recursion limited by a max depth argument.

Remaining tasks

N/A

User interface changes

None.

API changes

  • New $max_depth int optional argument in AnnotatedClassDiscovery (both Component and Core)
  • New $max_depth int optional argument in DefaultPluginManager.

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

claudiu.cristea’s picture

Assigned: Unassigned » claudiu.cristea
Status: Active » Needs review
FileSize
8.51 KB

Patch.

claudiu.cristea’s picture

Issue summary: View changes

Updated issue summary.

Status: Needs review » Needs work

The last submitted patch, plugin-discovery-recursion-2121541-1.patch, failed testing.

swentel’s picture

Status: Needs work » Closed (duplicate)
swentel’s picture

Issue summary: View changes

Updated issue summary.