Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nacmartin
Created May 16, 2010 15:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nacmartin/402939 to your computer and use it in GitHub Desktop.
Save nacmartin/402939 to your computer and use it in GitHub Desktop.
#!/bin/bash
SYMFREPO="git://symfony-git.git.sourceforge.net/gitroot/symfony-git/symfony-git"
DBUSER="root"
DBPASS=""
VENDOR_DIR="lib/vendor/symfony"
if [ -z "$DBPASS" ]; then
echo edit setupsymfony.sh to add your mysql password on line 4: DBPASS=\"password\"
exit
fi
if [ -z "$1" ]; then
echo usage: $0 project name
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
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
@miamibc
Copy link

miamibc commented Jan 3, 2011

Nice script for quick initialisation of project. Thank you!
I made small improvement and changed symfony repository url, seems that old one is broken :/

remote: Counting objects: 5854, done.
remote: Compressing objects: 100% (2469/2469), done.
remote: Total 5854 (delta 2995), reused 5854 (delta 2995)
Receiving objects: 100% (5854/5854), 3.06 MiB | 119 KiB/s, done.
Resolving deltas: 100% (2995/2995), done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment