PHPackages                             bangpound/composer-constants - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bangpound/composer-constants

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

bangpound/composer-constants
============================

Automatically define constants that expose details of the Composer configuration

2.0.0(2y ago)315.6k↓100%MITPHP

Since Dec 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/bangpound/composer-constants)[ Packagist](https://packagist.org/packages/bangpound/composer-constants)[ RSS](/packages/bangpound-composer-constants/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (6)Used By (0)

Composer Constants
==================

[](#composer-constants)

This Composer plugin defines constants within the generated `autoload.php` for the Composer autoloader factory class name, the composer.json file, the base directory, the bin directory, and the vendor directory.

If you need more runtime introspection in your Composer project, see [joshdifabio/composed](https://github.com/joshdifabio/composed).

Installation
------------

[](#installation)

```
composer require bangpound/composer-constants
```

Configuration
-------------

[](#configuration)

Set `composer-constant-prefix` if you want to override the default prefix `COMPOSER_`.

```
{
    "extra": {
        "composer-constant-prefix": "SPECIAL_COMPOSER_"
    }
}
```

Usage
-----

[](#usage)

When Composer dumps the autoloader, this plugin will prepend new constants for each of the values above.

Example `vendor/autoload.php`:

```
