A project template providing a better way to develop and deploy a website based on CodeIgniter framework.
- Use CodeIgniter as a web framework.
- Omit
index.php
in URL no matter where you place your website
(at document root, its subdirectory, or on a virtual host).
- Omit
- Use Git as a version control system.
- With pre-configured
.gitignore
. - Update CodeIgniter by updating the system submodule.
- With pre-configured
- Develop and test at local and then deploy to the live website.
- The project is deploying-independent and easy to set up.
- Deploy the website by
git push
.
- User-friendly configuration panel.
- The private zone.
- Compatible with Linux and Windows.
-
Download the latest project template, and unzip it.
-
Rename the folder
ci-proj-basis-master
as your own project name. -
Change directory to the folder, and execute the following commands:
git init git submodule add git:https://github.com/YiPo/ci-proj-system.git private/system git add . git commit -m "Initial commit"
-
Push this local repo to your remote repo.
(Replace<your-remote-repo>
to where your remote repo is.)git remote add origin <your-remote-repo> git push -u origin master
Run this command: (Replace <your-remote-repo>
to where your remote repo is)
git clone --recursive <your-remote-repo>
or execute the following command after cloning.
git submodule update --init --recursive
The config files that may vary from deployments are extracted from the project. These files (as below) are stored as templates in the folder ci-proj-admin/template
. Once you link to ci-proj-admin/
and enter the admin panel, these files are copied to their corresponding place and ready for configuring.
/.htaccess
(root/.htaccess
)/index.php
(root/index.php
)ci-proj-admin/.htaccess
(admin/.htaccess
)private/application/config/database.php
(config/database.php
)
The private
folder and anything in it are unreachable from the web.
-
Have your live website ready, see Clone a Repo and Configuration.
-
Let the
post-receive
hook of your remote repo access the pageci-proj-admin/deploy.php
of your website.
Create the file post-receive
in the hooks
folder of the remote
repo as follows:
(Replace user
, password
and path/to/website
to yours.)
#!/bin/sh
curl -k https://user:[email protected]/path/to/website/ci-proj-admin/deploy.php
and make sure the file is executable.
chmod +x post-receive
Set the webhook URL to the page ci-proj-admin/deploy.php
of your website, see Post-Receive Hooks for more information. The URL may looks like this:
(Replace user
, password
and path/to/website
to yours.)
https://user:[email protected]/path/to/website/ci-proj-admin/deploy.php
these libraries:
This software is licensed under the terms of the MIT License.