janschumann / classloader_composer
A simple module to autoload classes known to composer.
Installs: 3 125
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 1
Type:drupal-module
Requires
- php: >=5.3.3
- symfony/class-loader: ~2.4
This package is not auto-updated.
Last update: 2024-12-21 19:15:27 UTC
README
Overview
A simple module enables composer autoloading for drupal modules.
Installation
This project can be checked out with composer.
{ "require": { "janschumann/classloader_composer": "*" } }
Confguration
Usually no configuration is necessary.
Only if you have changed the vendor-dir
configuration option in your composer.json
file, the absolute path to this directory has to be made available to drupal:
Via shell script:
$ drush vset composer_vendor_dir <path/to/vendor/dir>
Via php:
variable_set('composer_vendor_dir', '<path/to/vendor/dir>');
Usage
After this module is required in your project´s composer.json
file, composer will autoload all classes added to the composer.json
autoload section:
{ "autoload": { "psr-0": { "My\\Namespace\\": "src" } } }