bangpound/composer-constants
Composer 安装命令:
composer require bangpound/composer-constants
包简介
Automatically define constants that expose details of the Composer configuration
README 文档
README
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.
Installation
composer require bangpound/composer-constants
Configuration
Set composer-constant-prefix if you want to override the default prefix COMPOSER_.
{
"extra": {
"composer-constant-prefix": "SPECIAL_COMPOSER_"
}
}
Usage
When Composer dumps the autoloader, this plugin will prepend new constants for each of the values above.
Example vendor/autoload.php:
<?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:
services: class_loader: class: Composer\Autoload\Classloader factory: [ '@=constant("COMPOSER_AUTOLOAD_CLASS")', getLoader ]
统计信息
- 总下载量: 15.63k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-27