]> git.pld-linux.org Git - packages/CodeIgniter.git/blob - codeigniter-install
- initial
[packages/CodeIgniter.git] / codeigniter-install
1 #!/bin/bash
2
3 function help() {
4 cat << EOF
5 Usage: $0 html_path app_path
6 html_path: directory, where your CodeIgniter's index.php is (e.g. ~/public_html/ci)
7 app_path: directory, where your CodeIgniter programs are (e.g. ~/programs/CI)
8 EOF
9 }
10
11 if [ $# -ne 2 ]; then
12         help
13         exit 1
14 fi
15
16 WEBDIR=$1
17 APPDIR=$2
18 CI_DIR=/usr/share/CodeIgniter
19
20 echo "Create web-directory ($WEBDIR)"
21 install -d $WEBDIR || exit 1
22 echo "Copy install.php to $WEBDIR"
23 install $CI_DIR/index.php $WEBDIR || exit 1
24 sed -i "s@\$application_folder.*=.*@\$application_folder = \"$APPDIR\";@" $WEBDIR/index.php || exit 1
25
26 echo "Create main app directory ($APPDIR)"
27 install -d $APPDIR || exit 1
28 echo "Creating directories to app directory"
29 for dir in config controllers core errors helpers hooks language libraries logs models third_party; do
30         install -d $APPDIR/$dir || exit 1
31         cp -r $CI_DIR/application/$dir/* $APPDIR/$dir || exit 1
32 done
33
34 echo Installation done.
35
This page took 0.071468 seconds and 3 git commands to generate.