Repository navigation
Configuration Files
Besides the environment variables, KeyAnyWhere has PHP configuration files in config/. This page explains which one you may change, in which order they are merged, and how to create config/app_local.php when you need to change a setting. A production installation that follows this wiki doesn't need any change here: config/app.php already reads everything it needs from the environment variables and ships with debug off.
KeyAnyWhere has three layers of configuration. Knowing them avoids losing your changes on the next upgrade.
| File | Versioned | Who changes it |
|---|---|---|
config/app.php |
yes | Nobody in an installation. It belongs to the project and is replaced on every upgrade. |
plugins/<Plugin>/config/app.php |
in the plugin | A local plugin, to change what it needs. |
config/app_local.php |
no (ignored by Git) | You. Optional: it only exists if you create it. |
They are merged in this order, each one overriding the previous: config/app.php → plugins (in the order of config/plugins.php) → config/app_local.php. The merge is key by key (CakePHP Hash::merge), so app_local.php only needs the keys you change. A numbered list, such as a log engine's levels, is appended to rather than replaced.
Important
Never edit config/app.php. A change there conflicts with the next git checkout of a new version. Put it in config/app_local.php instead.
Only do this when you have a setting to change. Start from an empty file rather than from config/app_local.example.php: the example is made for development (it reads DEBUG, renames the session cookie so it works on http://localhost, and configures DebugKit).
cd /var/www/keyanywhereprintf '%s\n' '<?php' '// Local settings of this installation. Merged over config/app.php.' 'return [' '];' > config/app_local.phpThen add your keys between return [ and ];, for example with nano config/app_local.php. Check the syntax after every change:
php -l config/app_local.phpThe command should print No syntax errors detected.
Two examples of keys to add to the array returned by config/app_local.php.
Session length, in minutes (the default is 240):
'Session' => [
'timeout' => 60,
],SMTP settings that are not in environment variables:
'EmailTransport' => [
'default' => [
'host' => 'ssl://smtp.example.com',
'port' => 465,
],
],Every available key is described in the CakePHP configuration chapter and in the comments of config/app.php. Keys specific to KeyAnyWhere (Kaw.*) are in Extension Points.
Source code · Issues · Releases · Packagist · Online demo · Hosted edition
1. Getting started
2. Installing in production
- Overview
- Preparing the Server
- Installing KeyAnyWhere
- File Permissions
- Generating Security Keys
- Environment Variables
- Configuration Files
- Database Setup
- Insecure Password Catalog
- Web Server and HTTPS
- First-Run Setup
3. Operating your installation
4. Using KeyAnyWhere
5. Security
6. Development
7. Extending