Drupal is a registered trademark of Dries Buytaert

classes_extractor

26 sites No security coverage
View on drupal.org

The Class Extractor Module is a powerful tool designed for Drupal developers. It provides a Drush command to extract all Backend classes from specified modules and generates a file containing the list of these classes. The module uses the Plugin System to enhance flexibility and maintainability, ensuring that class extraction logic can be easily extended without modifying the core code.

Additionally, the module exposes an API endpoint that allows external systems or other Drupal modules to retrieve the extracted class information.
Features

Drush Command:

Extracts Backend classes from one or more modules.
Saves the list of classes to a file for easy access or further processing.

API Endpoint:

Provides an endpoint to fetch the extracted class data programmatically.

Plugin System:

The module leverages Drupal's Plugin system for class extraction, allowing for easy addition of custom extraction logic without modifying the core code. You can create your own plugin to extend or modify the extraction process as needed.

Installation

Download and enable the module as you would for any other Drupal module.

Usage

Once installed and configured, the module provides a custom Drush command to extract all Backend classes from the specified modules.

Example Command:

drush cec

This command will extract the Backend classes and save them to a file. The file will contain a list of all classes found .

API Endpoint Usage: To access the list of extracted classes, you can make a request to the exposed API endpoint:

GET /api/extracted-classes

This will return a JSON response containing all the extracted classes.
Extending the Module

The Class Extractor module uses Drupal's Plugin System to allow you to create custom class extractors. If you need to implement custom extraction logic or handle specific class types, you can create a plugin to extend the functionality.

Example Plugin Creation:

Define a new plugin class that implements the ClassExtractorInterface.
Register the plugin with the plugin manager to make it available for use.

By using the plugin system, you can easily extend or modify the behavior of the Class Extractor Module to meet the specific needs of your project.

Sponsored and developed by:

Activity

Total releases
1
First release
Feb 2025
Latest release
1 year ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.0.1 Stable Feb 19, 2025