Composer Custom Directory Installer
A Composer plugin that installs packages into custom directories outside the vendor folder.
Repository Health
Technical Analysis
Composer Custom Directory Installer is a Composer plugin that lets you install packages into custom directories outside the default vendor folder. Unlike installers that add new non-Composer package types, it works with standard library-type packages and can be extended to any Composer package type through your root composer.json.
Install paths are configured declaratively in the extra section, with support for path variables (such as vendor and package name), variable flags, and layered matching strategies covering exact package names, package-type prefixes, and wildcard vendor globs. This makes it useful for monorepos, WordPress/Drupal layouts, and any project that needs dependencies placed at specific filesystem locations.
What You Get
- Custom install paths for Composer packages outside the vendor directory
- Path variables like vendor and package name for building target directories
- Layered matching: exact package name, package-type prefix, and wildcard vendor globs
- Extension to arbitrary Composer package types via
extra.installer-types - A configurable
installer-namefor finer control over placement
Common Use Cases
- Placing WordPress plugins or Drupal modules in framework-specific directories
- Organizing monorepo dependencies into custom paths outside vendor
- Installing specific packages to non-standard locations required by tooling
Under The Hood
Architecture - Under src/Composer, the package implements Composer’s PluginInterface and provides a custom Installer that overrides getInstallPath(). During installation Composer consults the plugin, which reads extra.installer-paths (and installer-types) from the root manifest and resolves the target directory by applying path variables and evaluating matching strategies in precedence order: exact package name, package-type prefix, then wildcard vendor glob.
Tech Stack - Pure PHP built against composer-plugin-api and composer/installers conventions. The repo includes a Dockerfile and Makefile for a reproducible development and test environment.
Code Quality - The project ships a PHPUnit suite (phpunit.xml with a tests directory) and consistent maintenance, appropriate for a small but widely depended-on Composer plugin (100k+ monthly installs).
API Design - There is no code API to learn; configuration is entirely declarative in composer.json, and the layered matching rules plus documented path-variable flags make intent explicit. This keeps the learning curve low for anyone already comfortable with Composer’s extra configuration.