Answer the question
In order to leave comments, you need to log in
What is extra in Composer json?
Hello, I found this line:
"extra": {
"bootstrap": "vendor\\mypackage\\Bootstrap"
},
interface BootstrapInterface{
public function bootstrap($arg);
}
Answer the question
In order to leave comments, you need to log in
https://getcomposer.org/doc/04-schema.md#extra
Arbitrary extra data for consumption by scripts.
This can be virtually anything.
optional.
In simple terms, this is a section in which you can set your custom parameters that will be used by your scripts or add-ons for Composer. For example, there is a composer/installers plugin that allows you to install packages not in the vendor, but in the right paths for different platforms/CMS. It uses the extra section to configure these paths. For example, for WordPress, it looks like this:
{
"extra": {
"wordpress-install-dir": "core",
"installer-paths": {
"app/{$name}": ["type:wordpress-dropin"],
"app/mu-plugins/{$name}": ["type:wordpress-muplugin"],
"app/plugins/{$name}/": ["type:wordpress-plugin"],
"app/themes/{$name}/": ["type:wordpress-theme"]
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question