exp:setupfiles
Copy .htaccess_root (or .htaccess_root_static) to .htaccess and config.php-RECOMMENDED to config.php, with a diff, a backup and --force for an existing file (dry run unless --apply).
Script bin/php/setupfiles.php, code in kernel/private/classes/commands/setupfiles.php. Run it from the installation root, as the user the web server runs as:
./console exp:setupfiles --help
./console exp:setup:htaccess --help
./console exp:setup:config --help
./console exp:setup:status --help
php bin/php/setupfiles.php --helpHelp text
Put .htaccess and config.php into place from the templates of the installation
./console exp:setup:htaccess [--static] [--force] [--apply] .htaccess_root (--static: .htaccess_root_static) -> .htaccess
./console exp:setup:config [--force] [--apply] config.php-RECOMMENDED -> config.php
./console exp:setup:status which template .htaccess and config.php come from
Nothing is written without --apply: the run shows what would be copied. --dry-run is the default
and may be given; --apply with --dry-run is a usage error (exit 2). An existing file that
differs from the template is shown as a diff (40 lines, -v all) and left alone unless --force; with --force --apply
it is backed up to var/backup/setup/<time>/ (mode and owner kept) and replaced.
A new file gets the template's mode and, run as root, the template's owner and group (as cp -a),
an existing one keeps its own; --mode and --owner set them. -v prints each copy as cp -v does.
Prints PASS or FAIL at the end; exit 1 when a file was refused or could not be written.Options
| Option | Value | Help |
|---|---|---|
--apply | Write: copy the file (the default only shows what would be copied) | |
--dry-run | The default, kept for scripts that pass it: show what would be copied, change nothing | |
--force | Replace an existing file that differs from the template (it is backed up first) | |
--static | htaccess: copy .htaccess_root_static, the rules that serve the static cache, instead of .htaccess_root | |
--root | required | The installation root (default: the installation this command belongs to) |
--owner | required | Owner of the written file, user or user:group (only root can give it to another user) |
--mode | required | Mode of the written file, such as 0644 (default: an existing file keeps its mode, a new one gets the template's) |
--show-secrets | config: show the values of passwords, secrets, keys and tokens in the diff |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Arguments: [verb].
Related
Generated by ./console exp:help:examples from bin/php/setupfiles.php, kernel/private/classes/commands/setupfiles.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.