#######################################
## Do Not Edit
## san2(at)linuxchannel.net
########################################
##
## zendopt.lib

zendopt_install_preview() {
    #if [ "$foundZendOpt" != "0" -a "$foundapache" != "0" -a "$foundphp" != "0" ] ; then
    if [ "$foundZendOpt" != "0" ] ; then
        echo "${T_MD}[$i] ${ZENDOPT_V}${T_ME} install to [/usr/local/php]"

        i=$(($i+1))
    #else
    #    echo "*** Notice!!! Not found ${WORK}/ZendOptimizer-xxx.tar.gz"
    #    echo "*** so SKIP ZendOptimizer install"
    #    echo "*** Do you have TWO(2) ZendOptimizer-xxx.tar.gz ???"
        fi
}

check_zendopt_install() {
    if [ X"$(grep "^zend_" "$phpinitarget" 2>/dev/null)" != "X" ] ; then
        cp -f "$phpinitarget" "${phpinitarget}.bak"
        sed 's/^zend_/;zend_/' "$phpinitarget" > "${phpinitarget}.new"
        mv -f "${phpinitarget}.new" "$phpinitarget"
    fi
}

zendopt_config() {

    check_zendopt_install

    addline1="zend_optimizer.optimization_level=15"
    addline2="zend_extension=\"$zendopttarget\""

    addfile $addline1 $phpinitarget
    addfile $addline2 $phpinitarget

    addfile "" $DONEFILE
    addfile "Added in $phpinitarget : $addline1" $DONEFILE
    addfile "Added in $phpinitarget : $addline2" $DONEFILE
}