Application mode not set by SLIM_MODE environment variable

Low priority issue

Working though the user guide (Slim 2.6.3) the Modes section states that “If Slim sees an environment variable named “SLIM_MODE”, it will set the application mode to that variable’s value.”

However, when I call $app->config(‘mode’) it returns the default “development” value.

I’ve tried using dotenv and even defining the variable on the line before the Slim object is initialised but the only way I can change the default value is adding a definition to the config array passed into the Slim constructor.

Just wanted to know if this is an issue or if I’ve missed something (wouldn’t be the first time).

I don’t know the answer, but I’m curious if this is a new project or existing. Slim 3 has been out for years, and 4 will be with us soon

An existing project that I want to contribute to is using Slim 2.6.3 so I’m going though the v2 docs. I’ve installed Slim via composer and am running my training environment in a Homestead Vagrant box.