janschumann/classloader_composer

A simple module to autoload classes known to composer.

1.0.1 2015-04-16 12:56 UTC

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

Bitdeli Badge