2017 © Pedro Peláez
 

composer-plugin composer-constants

image

bangpound/composer-constants

  • Saturday, January 2, 2016
  • by bangpound
  • Repository
  • 1 Watchers
  • 1 Stars
  • 13,431 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 4 % Grown

The README.md

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., (*1)

If you need more runtime introspection in your Composer project, see joshdifabio/composed., (*2)

Installation

composer require bangpound/composer-constants

Configuration

Set composer-constant-prefix if you want to override the default prefix COMPOSER_., (*3)

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

Usage

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

Example vendor/autoload.php:, (*5)

<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

if (!defined('COMPOSER_AUTOLOAD_CLASS')) {
    define('COMPOSER_AUTOLOAD_CLASS', 'ComposerAutoloaderInit283c0e3e301a833e1abc76806341c497');
}

if (!defined('COMPOSER_BASE_DIR')) {
    define('COMPOSER_BASE_DIR', '/srv/project');
}

if (!defined('COMPOSER_BIN_DIR')) {
    define('COMPOSER_BIN_DIR', '/srv/project/bin');
}

if (!defined('COMPOSER_FILE')) {
    define('COMPOSER_FILE', '/srv/project/composer.json');
}

if (!defined('COMPOSER_VENDOR_DIR')) {
    define('COMPOSER_VENDOR_DIR', '/srv/project/vendor');
}

return ComposerAutoloaderInit283c0e3e301a833e1abc76806341c497::getLoader();

If you want to use the Composer autoloader in your Symfony Dependency Injection Container, set up the service this way:, (*6)

services:
    class_loader:
        class: Composer\Autoload\Classloader
        factory: [ '@=constant("COMPOSER_AUTOLOAD_CLASS")', getLoader ]

The Versions

02/01 2016

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

02/01 2016

1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

 

The Development Requires

27/12 2015

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

  • composer-plugin-api ^1.0

 

The Development Requires

27/12 2015

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

  • composer-plugin-api ^1.0

 

The Development Requires