鋼の鍊魔術師

嵌入 FreeBSD 的心,修的是魔道還是正道?

Fork me on GitHub

Symfony2 Initial Project Script

This script use recommanded steps on symfony2 official site, just save it as symfony2_init.sh and chmod +x symfony2_init.sh, then you could start using ./symfony2_init.sh <project_name> to built each of your symfony2 project.

Note: you must change SYMFONY_VERSION if you want to use new version of symfony2.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
if ! test $# -eq 1
then
    echo 'Usage: ./symfony2_init.sh <project_name>'
    exit
fi

PROJECT_NAME=$1
SYMFONY_VERSION=2.0.7

# 1. fetch symfony
curl http://symfony.com/get/Symfony_Standard_$SYMFONY_VERSION.tgz -o symfony.tgz

# 2. extract and rename
mkdir $PROJECT_NAME
tar xvf symfony.tgz -C $PROJECT_NAME
cd $PROJECT_NAME
mv Symfony/* .
rmdir Symfony

# 3. add .gitignore
echo '/web/bundles/
/app/bootstrap*
/app/cache/*
/app/logs/*
/vendor/
/app/config/parameters.ini' > .gitignore

# 4. keep default setting samples
cp app/config/parameters.ini app/config/parameters.ini.dist

# 5. git init
git init
git add .
git ci -m 'Initial commit'

# 6. download vendor libraries
php bin/vendors install

refer: http://symfony.com/doc/current/cookbook/workflow/new_project_git.html

Comments