The `$locations` array mostly contains the paths of *extension PHP files*,
and the subsequent code filters with`dirname()` to strip them out.
Before: The path `/var/www/sites/all/modules/civicrm` was digested to
`/var/www/sites/all/modules/Civi/Api4/Subscribers`.
After: The path `/var/www/sites/all/modules/civicrm/Civi.php` is digested
`/var/www/sites/all/modules/civicrm/Civi/Api4/Subscribers`.
*/
public static function loadServices($namespace, $tag, $container) {
$namespace = \CRM_Utils_File::addTrailingSlash($namespace, '\\');
- $locations = array_merge([\Civi::paths()->getPath('[civicrm.root]/.')],
+ $locations = array_merge([\Civi::paths()->getPath('[civicrm.root]/Civi.php')],
array_column(\CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles(), 'filePath')
);
foreach ($locations as $location) {