Skip to content

Instantly share code, notes, and snippets.

@iegik
Last active January 27, 2021 09:09
Show Gist options
  • Save iegik/1268249 to your computer and use it in GitHub Desktop.
Save iegik/1268249 to your computer and use it in GitHub Desktop.
Create new CodeIgniter project
#!/bin/sh
# Creates new CodeIgniter project
if [ $1 ]; then
mkdir -p ./$1
ln -s ~/public_html/codeigniter/system/ ./$1/system
cp -r ~/public_html/codeigniter/app/ ./$1/app
cp ~/public_html/codeigniter/index.php ./$1
sed 's/RewriteBase \/~.*/RewriteBase \/~'`whoami`'\/'$1'/' ~/public_html/codeigniter/.htaccess > ./$1/.htaccess
sed 's/.base_url.*/"base_url"] = "http:\/\/'`hostname`'\/~'`whoami`'\/'$1'\/";/' ./codeigniter/app/config/config.php > ./$1/app/config/config.php
echo "You can see Your page on \"http://`hostname`/~`whoami`/$1\""
else
echo "usage: $ci [project name]"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment