ezpm.php

Summary

Package Manager. This documentation page applies to all version of ezpublish 4.x

Location

.//ezpm.php

Parameters

colors
db-host
db-name
db-password
db-socket
db-type
logfiles
login
no-colors
no-logfiles
password
repos
siteaccess

-c,--colors

Display output using ANSI colors (default).

--db-host HOST

Set host name for database connection.

--db-name NAME

Set name of database to use.

--db-password PASSWD

Set password for database user.

--db-socket SOCKET

Set socket for database connection.

--db-type TYPE

Set type of database to use.

--logfiles

Create log files.

-l,--login USER

login with USER and use it for all operations

--no-colors

Do not use ANSI coloring.

--no-logfiles

Do not create log files (default).

-p,--password PWD

Use PWD as password for USER

-r,--repos REPOS

Use REPOS for repository when accessing packages

-s,--siteaccess

Selected siteaccess for operations, if not specified default siteaccess is used

Description

The ezpm.php script, located in the root directory of eZ Publish, allows to execute package management operations from the command line.
This is very useful to eg. import a package that is too big and would result in a timeout if imported via the web interface (or viceversa to create a very big export package).

add <packagename> <contentobject> [options] [path|node]

Adding classes, templates and objects to the package.

Option

Description

--include-classes

Include class definitions in package (default)

--include-templates

Include related template files in package (default)

--exclude-classes

Do not include class definitions in package

--exclude-templates

Do not include related template files in package

--language

Comma separated list of languages to export. If not supplied the value is taken from settings. 

--current-version

Export only the published version for all objects. (default)

--all-versions

Export all versions for all objects.

--node-main

Export only main node for all objects. (default)

--node-selected

Export all nodes for all objects.

--siteaccess

Comma separated list of siteaccess to get definitions from, determines template override data and designs.
If not supplied the value is taken from default siteaccess.

path

The path is chosen in the same manner as the URL alias which is shown in the path in the browser. If you want to export all objects under the node you must add /* to the end of the path
e.g. news/this_is_news ,news or news/*
Note: To fetch the entire tree including users and media you must use an empty string, e.g. '' 

create <packagename> <summary>

$ php -C ezpm.php create staff "all the staff members"

export

Export packages for saving them

$ php -C ezpm.php export test_package --output -d /your/folder

info <packagename>

Show Information for packages

import

Load the package into the eZ Publish instance

$ php -C ezpm.php --debug import test_package-1.0-1.ezpkg

install

Integrate the package to the eZ Publish instance

$ php -C ezpm.php --debug install test_package

import and install

You can combine the import and install commands in one line.

$ php -C ezpm.php --debug import test_package-1.0-1.ezpkg php ezpm.php --debug install test_package

list

List all packages

set <package> <attribute> <attributevalue>

$ php -C ezpm.php set staff vendor "John Doe"

Edit package information

Examples

Filtering added content

You can filter content you are adding to packages. This is done by calling packagehandler classes (see kernel/classes/packagehandler) and specifying dedicated parameters. Note that this is not fully documented and not supported as the recommended way it to use the admin interface. The following command lines are just provided as examples of this usage.

Create a new package and add contentclasses to it

Note: If you're only adding content classes to your package, you should also set the type of the package to "contentclass".

$ php -C ezpm.php create testclasspackage
$ php -C ezpm.php add testclasspackage ezcontentclass folder,article
$ php -C ezpm.php set testclasspackage type contentclass
Create a new package and add a subtree to it (by path)
$ php -C ezpm.php create test_package "Test Package Creation"
$ php -C ezpm.php add test_package ezcontentobject --exclude-templates --exclude-classes --siteaccess=eng "your_path_to_content/*"
Create a new package and add a subtree to it (by nodeid)

Note: make sure to have the patch for https://jira.ez.no/browse/EZP-23299 applied. It is included in ezpublish 5.4, and will apply on older versions.

For example with node ID 74

$ php -C ezpm.php create test_package2 "Test Package Creation2"
$ php -C ezpm.php add test_package2 ezcontentobject --exclude-templates --exclude-classes --siteaccess=eng 74
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.