How *-local.php files are delivered to end user

When you follow the quide and install Yii 2 Advanced Project Template using Composer you are getting all the *-local.php files in place. Yet base repository does not contains them.

How it is achieved. What is responsible for delivering these files to the end user? Is it composer create-project or composer install or composer update? Is it init or something else?

I’d like to replicate such behaviour in my app, hence I am asking how it is done. Thanks.

These are copied by ./init from environments directory.