Skip to content

v2.5.2

Choose a tag to compare

@ttsuru ttsuru released this 16 Oct 20:37
· 8 commits to 2.x since this release
v2.5.2
e47c480

Important

The debug level comes from APP_DEBUG, and is 0 when it is not set. On a development machine, set APP_DEBUG=2 in config/.env.local.

Debug level and .env loading (PR #36)

  • config/core.php reads the debug level with Configure::write('debug', env('APP_DEBUG') ?? 0);.
  • The .env files are loaded with symfony/dotenv's loadEnv() instead of bootEnv(). The files and their order do not change. APP_DEBUG keeps the value you set (bootEnv() turned it into 1 or 0), and config/.env.local.php is no longer read.

Database configuration (PR #38)

  • config/database.php.default: $test is empty, and the constructor copies $default to it only when APP_ENV is test, so the tests use the database of config/.env.test. In any other environment the test connection is not configured, so tests cannot run on the database of that environment.
  • In $default, the keys that DATABASE_URL sets (datasource, host, login, password, database) are commented out, so they cannot be mixed with the DSN. Without DATABASE_URL, the default connection fails instead of using placeholder values.

Updating an Application

  1. In config/core.php, replace bootEnv(CONFIG . '.env') with loadEnv(CONFIG . '.env'), and the Configure::write('debug', ...) line with Configure::write('debug', env('APP_DEBUG') ?? 0);.
  2. Set APP_DEBUG=2 in config/.env.local on development machines. Leave it unset (or 0) in production.
  3. In config/database.php, copy the empty $test and the constructor from config/database.php.default.

Full Changelog: v2.5.1...v2.5.2