ezsubtreeremove.php

Summary

Safely removes large subtrees.

Location

./bin/php/ezsubtreeremove.php

Parameters

colors
debug
help
ignore-trash
logfiles
no-colors
no-logfiles
nodes-id
quiet
siteaccess

-c, --colors

Use ANSI colors when generating debug output (default).

-d[<option>[,<option2>...]], --debug[=<option>[,<option2>...]]

Output debug information. The following options can be used to control what the debug output should include: "all" (everything), "accumulator" (accumulators), "include" (included files), "timing" (timing points), "error" (errors), "warning" (warnings), "notice" (notices).

-h, --help

Output information about the script and supported parameters.

--ignore-trash

Permanently delete the specified subtrees. Without this parameter, the content will be moved to the trash (note that the tree structure will be lost forever).

--logfiles

Generate log files. This parameter must be used together with the debug parameter ("-d" or "--debug"). The log files (for example "warning.log") will be stored in the "var/log" directory of the eZ Publish installation.

--no-colors

Do not use ANSI colors when generating debug output.

--no-logfiles

Do not generate log files (default).

--nodes-id=<node_id>[,<node_id2>…]

The node ID of the subtree or subtrees that should be removed. In case multiple subtrees are to be removed, their node IDs must be provided as a comma separated list. Both the specified nodes and their sub items will be removed. This parameter is required.

-q, --quiet

Run the script in "quiet" mode. No output will be generated.

-s <siteaccess>, --siteaccess=<siteaccess>

The siteaccess to run the script for. If omitted, the default siteaccess will be used.

Description

This script makes it possible to remove subtrees. Typically, it is used to remove subtrees containing more nodes than the "MaxNodesRemoveSubtree" setting allows (these cannot be removed from within the administration interface).

By default, the script will remove content in the same way as it is done from within the administration interface when the "Move to trash" checkbox is selected. In other words, the removed objects will end up in the trash while the tree structure itself (the nodes) will be lost forever. The "--ignore-trash" parameter allows objects to be removed without being put in the trash first.

An object processed by this script will only be put in the trash (or removed when the "--ignore-trash" parameter is used) if it doesn't have other/additional locations than the ones that were specified using the "--nodes-id" parameter.

Note that the script will access the node tree as a certain user. This is controlled by the "UserCreatorID" setting. If the specified user is not allowed to remove a particular subtree, the script will output an error message.

Examples

Example 1

php bin/php/ezsubtreeremove.php --nodes-id=65

Remove node 65 and all its sub items. If the object encapsulated by node 65 does not have other locations, it will be moved to the trash.

Example 2

php bin/php/ezsubtreeremove.php --nodes-id=65 --ignore-trash

Remove node 65 and all its sub items. If the object encapsulated by node 65 does not have other locations, it will be permanently removed.

Example 3

php bin/php/ezsubtreeremove.php --nodes-id=60,65,78

Nodes 60, 65, 78 and all their sub items will be removed.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.