registry_autoload.api.php 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * @file
  4. * Hook implementations provided by registry_autoload.module.
  5. */
  6. /**
  7. * Alter hook to update the registry_autoload registry.
  8. *
  9. * This is useful to change the registry_autoload registry, before it is written
  10. * to the registry table.
  11. *
  12. * @param array $registry
  13. * An associative array keyed by filename with object values.
  14. * The objects have the following properties:
  15. * - classes: An associative array keyed by namespace+name with properties:
  16. * - type: Type of the class, can be 'interface' or 'class'.
  17. * - name: Name of the class or interface.
  18. * This can be empty if needs_update below is FALSE.
  19. * - filename: The filename of the file.
  20. * - module: The module this file belongs to.
  21. * - weight: The weight of the module this file belongs to.
  22. * - hash: The file_hash() of the filename.
  23. * - needs_update: Whether the registry needs to be updated or not.
  24. */
  25. function hook_registry_autoload_registry_alter(array &$registry) {
  26. // Remove all classes within RegistryAutoloadTestTest.php as defined by
  27. // registry_autoload_test module within the includes/ directory.
  28. $module_path = drupal_get_path('module', 'registry_autoload_test');
  29. $filename = 'includes/RegistryAutoloadTestTest.class.php';
  30. $path = $module_path . '/' . $filename;
  31. unset($registry[$path]);
  32. }