exp:ezsubtreecopy
Available before Exponential 6: the 4.x kernel had it already; the 4.x reference had no page for it.
Summary
Copy a content subtree to a new location (--src-node-id, --dst-node-id; dry run unless --apply)
Usage
./console exp:ezsubtreecopy [options] php bin/php/ezsubtreecopy.php [options]
Help
The output of ./console help exp:ezsubtreecopy (the script run with --help), without the standard options:
Usage: bin/php/ezsubtreecopy.php [OPTION]...
This script will make a copy of a content object subtree and place it in a specified
location.
Without --apply nothing is copied: the script lists the nodes of the subtree it would copy.
--dry-run means the same as no flag; --apply together with --dry-run is a usage error (exit 2).
Example: ./bin/php/ezsubtreecopy.php --src-node-id=2 --dst-node-id=5
./bin/php/ezsubtreecopy.php --src-node-id=2 --dst-node-id=5 --apply
Options:
--apply Copy the subtree (the default is a dry run that lists it and copies nothing)
--dry-run The default: list the nodes that would be copied, change nothing
--src-node-id=VALUE Source subtree parent node ID.
--dst-node-id=VALUE Destination node ID.
--all-versions Copy all versions for each contentobject being copied.
--keep-creator Do not change the creator (user) for the copied content objects.
--keep-time Do not change the creation and modification time of the copied content objects.Options
| Option | Value | Description |
|---|---|---|
| --apply | - | Copy the subtree (the default is a dry run that lists it and copies nothing) |
| --dry-run | - | The default: list the nodes that would be copied, change nothing |
| --src-node-id | required | Source subtree parent node ID. |
| --dst-node-id | required | Destination node ID. |
| --all-versions | - | Copy all versions for each contentobject being copied. |
| --keep-creator | - | Do not change the creator (user) for the copied content objects. |
| --keep-time | - | Do not change the creation and modification time of the copied content objects. |
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/ezsubtreecopy.php, kernel/private/classes/commands/ezsubtreecopy.php
See also
Generated example: exp:ezsubtreecopy
Added to the reference for Exponential 6.0.15.
Contributors
- Graham Brookins Updated
Comments
Add a comment