yiisoft/composer-config-plugin

Add runtime-only mode

Opened this issue · 5 comments

Could be useful for debug/development use. See #84.

Please think about how developer uses configuration. Configuration changes as app evolves.

Rebuilding config manually every time after each change in settings is annoying. It is doubling developer work.

Automated rebuild on every app run is extra work for hardware, it is waste of resources and time and should be avoided.

There is no need to write builded configaration to disk in development environment. It is meaningless.

Just read whole thing in memory and let the app run with it.

There are two modes: development/debug and production.

In development mode:

  1. It's a good idea to rebuild config every request.
  2. There's no need to write cache to disk.

In production mode:

  1. We can save resources by not rebuilding every request.
  2. We have to write cache to disk.

We can save resources by not rebuilding every request

It's not about resources. It's about latency.
It can take more time to rebuild config (read and merge all the files) then request processing itself.

In case rebuild() is done in debug mode we are already doing that so there will be a bit less time spent since we'll not write to files and read from files.

Partially done. Files are still dumped but there's no need for composer dump-autoload anymore if rebuild() is called.