Zend Server User Guide > Tasks > Working with Libraries > Using Libraries

Using Libraries

This page describes how to use PHP libraries deployed on Zend Server. Since libraries can be installed on your server independently of your application, applications can be much more agile and lighter. All you have to do is insert an API call, supplied by Zend Server, to the include path of the library you wish to consume.

Note:

This procedure describes how to use libraries already installed on Zend Server. To use another library, package and deploy it to Zend Server before completing this procedure.

 

 

Instructions on how to complete a procedure

To use a library:

  1. In the UI, go to the Applications | Libraries page.
  2. From the Libraries list, select the library you wish to use in your application.
    The Expanded view is displayed.
  3. In the Expanded view, copy the API call specified in the 'Library Path' field. For example:

zend_deployment_library_path('Zend Framework 2', '2.0');

  1. In your application, locate the entry-point file that specifies the include path of the library used by your application (e.g., 'init_autoloader.php'), and insert the API call. For example:

$zf2Path = zend_deployment_library_path('Zend Framework 2', '2.0');

 

Tip:

To instruct the application to automatically use the latest available version of this library, and not a specific version, omit the version number (e.g., 'Zend Framework 2' instead of 'Zend Framework 2', '2.0').

If you do not enter the specific library version number in the API call, your application will use the default library version. For more information, see Setting a Default Library Version.

 

Read Also

  Libraries    
  Working with Libraries    
  Preparing the Package Using the Deployment Tool