# Programs location TAR=`which tar` if [ ! "$TAR" ] ; then echo "ERROR: tar - command not found" exit 1 fi SVN=`which svn` if [ ! "$SVN" ] ; then echo "ERROR: svn - command not found" exit 1 fi MYSQL=`which mysql` if [ ! "$MYSQL" ] ; then echo "ERROR: mysql - command not found" exit 1 fi MYSQL_DUMP=`which mysqldump` if [ ! "$MYSQL_DUMP" ] ; then echo "ERROR: mysqldump - command not found" exit 1 fi # MySQL Access if [ -f "/usr/bin/php" ] ; then PHP="/usr/bin/php" else PHP="/usr/local/lib/php5.4/bin/php" fi php=" error_reporting(0); chdir('../www'); require_once('_lib/_sys/init.php'); \$config = Zend_Registry::get('config'); echo \"DB_HOST='\" . \$config->database->params->host . \"'; \"; echo \"DB_PORT='\" . \$config->database->params->port . \"'; \"; echo \"DB_USER='\" . \$config->database->params->username . \"'; \"; echo \"DB_PASS='\" . \$config->database->params->password . \"'; \"; echo \"DB_NAME='\" . \$config->database->params->dbname . \"'; \"; " dbinfo=$($PHP -r "$php" 2>/dev/null) eval $dbinfo if [ ! "$DB_PORT" ] ; then DB_PORT="3306" fi if [ ! "$DB_USER" -o ! "$DB_NAME" ] ; then echo "ERROR: can not read database configuration" exit 1 fi # echo h:$DB_HOST P:$DB_PORT u:$DB_USER p:$DB_PASS d:$DB_NAME ; exit 1 #if [ "1" != "`echo ""select 1"" | $MYSQL -s -h $DB_HOST -P $DB_PORT -u $DB_USER -p$DB_PASS $DB_NAME`" ] ; then # echo "ERROR: can not connect to database" # exit 1 #fi . _defines.sh