#!/bin/bash

dir="";
while [ "$dir" = "" ]
do    
    read -p "Enter project name: " dir;
    if [ -d "$dir" ] && [ "$(ls $dir)" ]; then dir=""; echo "Error: directory is not empty."; fi
done

mkdir -p $dir;
rm -rf install.sh

php -d memory_limit=-1 /usr/local/bin/composer create-project symfony/framework-standard-edition $dir "2.8.*";
cd $dir;
php -d memory_limit=-1 /usr/local/bin/composer require unitkit/uk-install-bundle;
wget https://bitbucket.org/unitkit/uk-installer/downloads/.htaccess
