By tstoeckler on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Issue links:
Description:
The function drupal_classloader() was removed.
Even though module namespaces are registered automatically it could be used in the rare case where an additional namespace needs to be registered and drupal_classloader_register() was not adequate.
For this, the class_loader service should be used directly now.
For example:
// Drupal 8 before this change
drupal_classloader->addPsr('Some\Custom\Namespace', array(drupal_get_path('module', 'mymodule') . '/some/directory'));
// Drupal 8 after this change. (Works before the change as well.)
\Drupal::service('class_loader')->addPsr('Some\Custom\Namespace', array(drupal_get_path('module', 'mymodule') . '/some/directory'));
Impacts:
Module developers