Skip to content

A simple module that utilizes composer´s autoload_namespaces.php to manage autoloading

License

Notifications You must be signed in to change notification settings

janschumann/drupal-composer-classloader

Repository files navigation

Drupal composer classloader

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"
        }
    }
}

Bitdeli Badge

About

A simple module that utilizes composer´s autoload_namespaces.php to manage autoloading

Resources

License

Stars

Watchers

Forks

Packages

No packages published