Skip to content

Instantly share code, notes, and snippets.

@miamibc
Forked from nacmartin/setupsymfony.sh
Created January 3, 2011 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miamibc/764126 to your computer and use it in GitHub Desktop.
Save miamibc/764126 to your computer and use it in GitHub Desktop.
#!/bin/bash
SYMFREPO="git://symfony-git.git.sourceforge.net/gitroot/symfony-git/symfony-git" #this not works now
SYMFREPO="https://github.com/symfony/symfony1.git"
VENDOR_DIR="lib/vendor/symfony"
DBUSER="root"
DBPASS=""
AUTHOR=""
if [ -z "$DBPASS" ]; then
echo edit setupsymfony.sh to add your mysql password on line 8: DBPASS=\"password\"
exit
fi
if [ -z "$AUTHOR" ]; then
echo edit setupsymfony.sh to add author line 9: AUTHOR=\"author\"
exit
fi
if [ -z "$1" ]; then
echo usage: $0 projectname
exit
fi
mkdir $1
cd $1
git init
git clone $SYMFREPO $VENDOR_DIR
git submodule add $SYMFREPO $VENDOR_DIR/
git submodule foreach 'git submodule init && git submodule update'
git commit -m 'Initial commit; initialized symfony-git (1.4)'
$VENDOR_DIR/data/bin/symfony generate:project $1
echo "config/databases.yml" > .gitignore
echo "cache/*" >> .gitignore
echo "log/*" >> .gitignore
./symfony project:permissions
./symfony configure:author "$AUTHOR"
git add .
git commit -m 'Initialized symfony project'
./symfony generate:app frontend
git add .
git commit -m 'Initialized frontend application'
mysqladmin -u$DBUSER -p$DBPASS create $1
./symfony configure:database "mysql:dbname=$1;hostname=localhost" $DBUSER $DBPASS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment