yiisoft/composer-config-plugin

Add support for operating modes ("dev" / "prod").

Opened this issue · 0 comments

The new operating logic is as follows:

The composer.json has a "config-plugin-output-dir" parameter.

  1. When referring to Builder::path, we look, if this folder contains a subfolder 'prod', then we give the path to the config in this folder. If this folder does not have a 'prod' subfolder, return the config from the 'dev' subfolder.
  2. The first time you use Builder::path from the 'dev' folder, run Builder::rebuild();.

The Builder should receive the following features:

class Builder {
    ...
    public function buildProd() {
        Builder::rebuild();
        copyFolder('dev', 'prod');
    }
    public function clearProd() {
        removeFolder('prod');
    }
    ...
}