Autoregisters extensions downloaded via Composer
New BSD
- Nette Framework 2.0.4
- Get the source code from Github.
- Register as compiler extension.
$configurator->onCompile[] = function ($configurator, $compiler) {
$compiler->addExtension('composer', new VojtechDobes\ComposerExtension);
};
Since now, all compiler extensions acquired via Composer are automatically registered.
You may override default naming with this syntax:
composer:
alias:
dg/dibi: dibi
kdyby/redis-extension: redis
Some common packages are already aliased, see source code for complete list. If you don't want to use these default aliases, it is also possible:
composer:
default: no
Aliases listed in config section always override default ones.
You may also use different naming strategy:
composer:
default: short
If alias is not defined, it will use the second part of package name.
dg/dibi
will becomedibi
kdyby/redis-extension
will becomeredis-extension