#!/bin/bash

# Get current script directory.
CWD=`dirname $0`

# Get PHP version.
PHP_VERSION=`php -v`

# Install dependencies if PHP version is 5.6 or 7.0.
if [[ $PHP_VERSION =~ "PHP 5.6" || $PHP_VERSION =~ "PHP 7.0" ]] ; then
    echo "Current working directory is: $CWD"
    echo "PHP version is: $PHP_VERSION"
    composer install --prefer-dist --no-interaction --working-dir "$CWD"
else
    echo "No installing dependencies for PHP version: $PHP_VERSION"
fi
