Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

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).

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/examples/commands/setupfiles.md

On this page

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 --help

Help 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

OptionValueHelp
--applyWrite: copy the file (the default only shows what would be copied)
--dry-runThe default, kept for scripts that pass it: show what would be copied, change nothing
--forceReplace an existing file that differs from the template (it is backed up first)
--statichtaccess: copy .htaccess_root_static, the rules that serve the static cache, instead of .htaccess_root
--rootrequiredThe installation root (default: the installation this command belongs to)
--ownerrequiredOwner of the written file, user or user:group (only root can give it to another user)
--moderequiredMode of the written file, such as 0644 (default: an existing file keeps its mode, a new one gets the template's)
--show-secretsconfig: 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].


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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x