Application specific Zend_Tool providers in Zend Framework

Currently the only way for Zend_Tool to pick up your custom providers is to add the provider directory to the php include path. This is especially problematic if you have multiple applications in one server.

One workaround I use is to create a script wrapping zf.sh in [APP_ROOT]/script:

#!/bin/sh

ZF_CONFIG_FILE = $(pwd)’/application/configs/zf.ini’

export ZF_CONFIG_FILE

ZEND_TOOL_INCLUDE_PATH_PREPEND = $(pwd)’/providers’

export ZEND_TOOL_INCLUDE_PATH_PREPEND

`which zf` $@

If you have integrated the Zend library in your application, you can add the zf scripts in the same folder as the script. The last line then becomes:

$(pwd)/script/zf.sh $@

Now you can use script/zfc instead of zf and all of your custom providers should get loaded correctly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s