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.