Understanding the Library Package Structure

This topic will help you understand the structure of the .zpk package which contains the data, scripts, and an XML descriptor file for your library.

Package Structure

The .zpk package contains the following components:


The library's main data directory for inclusion in the package. It contains the library files, deployment scripts, and extra resources such as icons, EULA and README (.txt/.md) files.

By default, this folder is called 'Data' but you can name it differently and reference it accordingly when building your package.

Descriptor File (deployment.xml)

This XML file, which is defined by an XSD file, describes all necessary information in order to deploy your library using Zend Server’s deployment feature, and contains:

  • type - The type of package: PHP application or library.

  • name (Required) - The library name.
  • summary - The library short description.

  • description - The library long description.

  • version (Required) - The library version number.

  • releasedate - The library release date.
  • libdir - The library's directory. By default, this is the data folder of your package.
  • scriptsdir - The directory in which your scripts are located. By default, this is the scripts folder of your package.

  • updateurl - The URL for updating libraries.
  • dependencies - The dependencies that must be met (and will be validated) during the deployment process.

  • user parameters - The parameters for the deployment process. These, along with the values you define, will appear in the User Parameters dialog during deployment. For more information see Deploying Libraries.

For an example of the descriptor template see The XML Descriptor File.


Zend Server Deployment allows you to insert scripts during the staging process of the library deployment:

  • Pre-stage - All customized actions that must be executed before the staging process begins.  
  • Post-stage - All customized actions that must be executed after the staging process ends.  

See Preparing the Package Using the Deployment Tool to learn how to build your library package.

Hook Script Examples

The following is a list of examples for operations that may be defined in each hook script:

  • Pre-stage - Validate and applying user customized parameter values, verify the existence of generic prerequisites, etc.

  • Post-stage - Create a new database schema, modify a file or directory permissions on staged source files, etc.