exp:adddefaultstates
Available before Exponential 6: the 4.x kernel had it already; the 4.x reference had no page for it.
Summary
Give every content object the default state of each state group it has no state of (dry run unless --apply)
Usage
./console exp:adddefaultstates [options] php bin/php/adddefaultstates.php [options]
Help
The output of ./console help exp:adddefaultstates (the script run with --help), without the standard options:
Usage: bin/php/adddefaultstates.php [OPTION]...
Adds default states to content objects: every object that has no state of a state group gets
the group's default state (the state with priority 0). Objects with a state of the group are left
alone, so the script can run again. Prints PASS or FAIL at the end.
Without --apply nothing is written: the script lists per state group how many objects would get
its default state. --dry-run means the same as no flag; --apply together with --dry-run is a usage
error (exit 2).
Example: php bin/php/adddefaultstates.php
php bin/php/adddefaultstates.php --apply
Options:
--apply Add the states (the default is a dry run that lists them and changes nothing)
--dry-run The default: list how many objects would get a default state, change nothingOptions
| Option | Value | Description |
|---|---|---|
| --apply | - | Add the states (the default is a dry run that lists them and changes nothing) |
| --dry-run | - | The default: list how many objects would get a default state, change nothing |
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/adddefaultstates.php, kernel/private/classes/commands/adddefaultstates.php
See also
Generated example: exp:adddefaultstates
Added to the reference for Exponential 6.0.15.
Contributors
- Graham Brookins Updated
Comments
Add a comment