Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which folders to ignore in a codeigniter app when using version control

Which folders should I ignore when using version control on a project developed on the CodeIgniter framework?

I am already ignoring the application/cache folder, but are there any else?

like image 765
longneck Avatar asked Dec 19 '11 22:12

longneck


People also ask

Can I have multiple CodeIgniter applications in one folder?

It is possible, however, to have multiple sets of applications that share a single CodeIgniter installation, or even to rename or relocate your application directory. If you would like to rename your application directory you may do so as long as you open your main index.php file and set its name using the $application_folder variable:

What files are in the CodeIgniter public folder?

All files in this directory live under the CodeIgniter namespace. The public folder holds the browser-accessible portion of your web application, preventing direct access to your source code. It contains the main .htaccess file, index.php, and any application assets that you add, like CSS, javascript, or images.

Can I modify the system directory in CodeIgniter?

While you have a lot of flexibility in how you use the application directory, the files in the system directory should never be modified. Instead, you should extend the classes, or create new classes, to provide the desired functionality. All files in this directory live under the CodeIgniter namespace.

How do I share a CodeIgniter installation?

If you would like to share a common CodeIgniter installation to manage several different applications simply put all of the directories located inside your application directory into their own sub-directory. For example, let’s say you want to create two applications, named “foo” and “bar”.


2 Answers

You can ignore any application generated logs and any development specific configuration files. Here's a commonly used .gitignore file for CodeIgniter:

*/config/development
*/logs/log-*.php
*/logs/!index.html
*/cache/*
*/cache/!index.html

https://github.com/github/gitignore/blob/master/CodeIgniter.gitignore

like image 113
birderic Avatar answered Sep 20 '22 02:09

birderic


Beyond the default github codeigniter template provided by birderic, (at https://github.com/github/gitignore/blob/master/CodeIgniter.gitignore for good measure) I also like to simply exclude any php file in the /config director with

*/config/*.php

Some third party apps, like HybridIgnite, like to put their configuration files in the /config directory and a limited config block might enable on of these files to be tracked... Better safe than sorry...

To make it clear how config files should work, I keep a copy of the default files (with no passwords of course) in a seperate config_template directory.

HTH, -FT

like image 31
ftrotter Avatar answered Sep 22 '22 02:09

ftrotter