Skip to content

Commit

Permalink
update APC download with fall back local mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
centminmod committed Jun 21, 2014
1 parent 31e9131 commit fd7fc1f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
1 change: 1 addition & 0 deletions inc/downloadlinks.inc
Expand Up @@ -147,6 +147,7 @@ XCACHE_LINK="http://xcache.lighttpd.net/pub/Releases/${XCACHE_VERSION}/${XCACHE_

APCCACHE_LINKFILE="APC-${APCCACHE_VERSION}.tgz"
APCCACHE_LINK="http://pecl.php.net/get/${APCCACHE_LINKFILE}"
APCCACHE_LINKLOCAL="http://centminmod.com/centminmodparts/apc/php550/${APCCACHE_LINKFILE}"

ZENDOPCACHE_LINKFILE="zendopcache-${ZOPCACHECACHE_VERSION}.tgz"
ZENDOPCACHE_LINK="http://pecl.php.net/get/${ZENDOPCACHE_LINKFILE}"
Expand Down
52 changes: 50 additions & 2 deletions inc/downloads.inc
Expand Up @@ -1727,6 +1727,52 @@ fi

}

###############################################
apclocaltarball() {

echo ""
if [ "$UNATTENDED" == 'n' ]; then
read -ep "Install APC? (By default uses 32MB RAM) [y/n] " askapcinstall
else
askapcinstall='y'
fi #unattended
if [[ "$askapcinstall" = [yY] ]]; then
APCINSTALL='y'
cd $DIR_TMP

rm -rf APC*

cecho "Download local ${APCCACHE_LINKFILE} ..." $boldyellow
if [ -s ${APCCACHE_LINKFILE} ]; then
cecho "${APCCACHE_LINKFILE} Archive (local) found, skipping download..." $boldgreen
else
$DOWNLOADAPP ${APCCACHE_LINKLOCAL} $WGETRETRY
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: ${APCCACHE_LINKFILE} local download failed." $boldgreen
checklogdetails
exit #$ERROR
else
cecho "Download local done." $boldyellow
#echo ""
fi
fi

tar xzf ${APCCACHE_LINKFILE}
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: ${APCCACHE_LINKFILE} (local) extraction failed." $boldgreen
checklogdetails
exit #$ERROR
else
cecho "${APCCACHE_LINKFILE} (local) valid file." $boldyellow
echo ""
fi

fi

}

###############################################
apctarball() {

Expand Down Expand Up @@ -1760,8 +1806,10 @@ tar xzf ${APCCACHE_LINKFILE}
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: ${APCCACHE_LINKFILE} extraction failed." $boldgreen
checklogdetails
exit #$ERROR
cecho "trying local mirror download..." $boldgreen
apclocaltarball
# checklogdetails
# exit #$ERROR
else
cecho "${APCCACHE_LINKFILE} valid file." $boldyellow
echo ""
Expand Down

0 comments on commit fd7fc1f

Please sign in to comment.