colors
db-host
db-name
db-password
db-socket
db-type
logfiles
login
no-colors
no-logfiles
password
repos
siteaccess
Display output using ANSI colors (default).
Set host name for database connection.
Set name of database to use.
Set password for database user.
Set socket for database connection.
Set type of database to use.
Create log files.
login with USER and use it for all operations
Do not use ANSI coloring.
Do not create log files (default).
Use PWD as password for USER
Use REPOS for repository when accessing packages
Selected siteaccess for operations, if not specified default siteaccess is used
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).
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. |
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 |
$ php -C ezpm.php create staff "all the staff members"
Export packages for saving them
$ php -C ezpm.php export test_package --output -d /your/folder
Show Information for packages
Load the package into the eZ Publish instance
$ php -C ezpm.php --debug import test_package-1.0-1.ezpkg
Integrate the package to the eZ Publish instance
$ php -C ezpm.php --debug install test_package
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 all packages
$ php -C ezpm.php set staff vendor "John Doe"
Edit package information
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.
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
$ 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/*"
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 74Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.