Chapter 4. Deploying applications with DB2 177
# -r specify to configure system variable for ODBC and CLI driver
#
# example: php_app_install -p /home/db2app/myapp -r"
#
##########################################################################
#set -x
# Define variables
DIR_DRV=odbcdrv # directory for odbc and cli driver files
DIR_APP=bin # directory for applications
DIR_PHP=phpdriver # directory for driver file
unset REGVAR
# command-line syntax
syntax()
{
echo "
php_app_install -p <installpath> -r
-p specify the location where application and ODBC lib files will be deployed
-r specify to configure system variable for ODBC and CLI driver
example: php_app_install -p /home/db2app/myapp -r"
}
# main program
# process command-line options
case $# in
0) syntax
exit 1;;
*)
while getopts "p:r" OPT;
do
case $OPT in
p) INSTPATH=$OPTARG
mkdir -p $INSTPATH ;;
r) REGVAR=Y ;;
?) echo "invalid command line option $*"
syntax
exit 1 ;;
esac
done
;;
esac
# verify the ODBC driver files and application files are ready
# and then start the deployment
TESTPATH=`echo $0|egrep '^/'`
if [ -z $TESTPATH ]; then
dirname `pwd`/$0|read CURPATH
else
CURPATH=`dirname $0`
fi