Skip to the content
Documentation

exp:configphp

No ratings yet

Available since Exponential 6.0.15 (in development, not in a release yet).

Summary

List, read, set and unset the define() settings of config.php, typed and checked with php -l, documented by config.php-RECOMMENDED (set and unset: dry run unless --apply)

Usage

./console exp:configphp [options]
php bin/php/configphp.php [options]

Help

The output of ./console help exp:configphp (the script run with --help), without the standard options:

Usage: bin/php/configphp.php [OPTION]... [VERB] [NAME] [VALUE]
The define() settings of config.php

  ./console exp:config:list [--only-set] [--format=text|json]     every setting config.php-RECOMMENDED documents, with
                                                                 the value config.php has, the proposed one and the description
  ./console exp:config:get <NAME> [--format=text|json]           the value (exit 1 when it is not set)
  ./console exp:config:set <NAME> <value> [--type=<t>] [--apply] set it: in place, else where the documentation has it, else added
  ./console exp:config:unset <NAME> [--apply]                    comment it out again

config.php is read as PHP tokens, never run; only the value of the one define() changes, comments and
order stay. set and unset show the diff and write nothing without --apply (--dry-run is the default;
both together: exit 2). A write backs config.php up to var/backup/config/<time>/ (mode and owner
kept), checks the new file with php -l and renames it into place. A config.php that does not compile is
refused. Values of names with PASS, SECRET, KEY, TOKEN are shown as ******** unless --show-secrets.
Types (--type): bool, int, octal, float, string, null; without --type the current or the documented
value decides, true/false/null are always the PHP values. A value starting with "-": --value=<value>.


Options:
  --apply              set, unset: write config.php (the default shows the diff)
  --dry-run            The default, kept for scripts that pass it: show the diff, change nothing
  --type=VALUE         set: the type of the value: bool, int, octal, float, string, null
  --value=VALUE        set: the value (instead of the argument after the name), for one that starts with "-"
  --allow-unknown      set: add a setting config.php-RECOMMENDED does not document
  --show-secrets       Show the values of passwords, secrets, keys and tokens
  --format=VALUE       list, get: text (default) or json
  --only-set           list: only the settings config.php sets
  --root=VALUE         The installation root (default: the installation this command belongs to)
  --file=VALUE         The config file (default: <root>/config.php)
  --recommended=VALUE  The documented settings (default: <root>/config.php-RECOMMENDED)

Options

Option Value Description
--apply - set, unset: write config.php (the default shows the diff)
--dry-run - The default, kept for scripts that pass it: show the diff, change nothing
--type required set: the type of the value: bool, int, octal, float, string, null
--value required set: the value (instead of the argument after the name), for one that starts with "-"
--allow-unknown - set: add a setting config.php-RECOMMENDED does not document
--show-secrets - Show the values of passwords, secrets, keys and tokens
--format required list, get: text (default) or json
--only-set - list: only the settings config.php sets
--root required The installation root (default: the installation this command belongs to)
--file required The config file (default: <root>/config.php)
--recommended required The documented settings (default: <root>/config.php-RECOMMENDED)

Arguments

[verb][name][value]

Standard options

Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.

Source

bin/php/configphp.php, kernel/private/classes/commands/configphp.php

See also

Generated example: exp:configphp

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.