EXTENSIONS
EXTENSIONS = ['module', 'install', 'inc', 'theme', 'profile', 'engine']
File extensions an extension's main file can have.
Finds an extension's path while its own file is being included and no container exists yet.
Drupal 7 modules start with require_once drupal_get_path('module', 'x') . '/x.inc';. Drupal 11
includes procedural module files while it compiles a container, before \Drupal holds one, so the
path resolver service is out of reach. The file being included is on the call stack, and its
directory is the answer.
find(string $name, array> $trace, string $root) : string|null
Looks for the extension's file among the frames of a backtrace.
| string | $name | The extension machine name. |
| array |
$trace | Frames as |
| string | $root | The application root the answer is relative to. |
The directory relative to the root, or null when no frame belongs to the extension.