Skip to the content
Documentation

exp:setupfiles

No ratings yet

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

Summary

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)

Usage

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

Help

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

Usage: bin/php/setupfiles.php [OPTION]... [VERB]
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:
  --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=VALUE    The installation root (default: the installation this command belongs to)
  --owner=VALUE   Owner of the written file, user or user:group (only root can give it to another user)
  --mode=VALUE    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

Options

Option Value Description
--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

Arguments

[verb]

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/setupfiles.php, kernel/private/classes/commands/setupfiles.php

See also

Generated example: exp:setupfiles

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.