Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved CodeIgniter .gitignore to support an system directory in a d…
…ifferent location to the default install. Fixed database.php ignore rule. The application directory can be moved to any location and the ignore will still operate
- Loading branch information
1aa8f64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't config/config.php be ignored too, considering it has the base url, and some settings that may change on each environment?
1aa8f64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey seppo0010, thanks for taking the time to comment.
Personally I don't ignore config.php becasue a lot of the options are impacted by code changes and need to be consistent across all systems e.g. permitted_uri_chars, enable_query_strings, subclass_prefix, charset. So if I changed permitted_uri_char, which I recently did for a Sage Pay integration, I want to be able to commit the change. Sending an email around + manually updating the production system is not reliable.
The only config setting I have needed to change on an instance by instance basis is log_threshold, set to 1 (Error Messages (including PHP errors)) in version control, which is sometimes useful to change when debugging locally.
As for base_url I use$config['base_url'] = "http://$ {_SERVER['HTTP_HOST']}"; to get around the hard coded url issue.
Some complex setups may have custom base_url rules but this would be the exception.
Personally I ignore constants.php so each system can run their own (e.g. notifications emails, enabling profiler etc) but again this is perhaps not a typical use so I didn't include it in my .gitignore.
Let me know your thoughts.
1aa8f64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both ways are OK... I'd prefer to ignore the file, but it makes sense also not to do it.
I don't like relying on HTTP_HOST for the base_url, because I don't always work on the "/", sometimes I run CI on a subdirectory.
1aa8f64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey,
"I don't like relying on HTTP_HOST for the base_url, because I don't always work on the "/", sometimes I run CI on a subdirectory."
-> Yeah I often do this. I might have the main website powered by a CMS and then be using a CI installation (e.g. /apps) for the more complex functionality. I need to keep the subdirectory name consistent for all systems because of the way the CMS and CI link and integrate so I simply add this to the base url e.g.
config['base_url'] = "http://${_SERVER['HTTP_HOST']}/apps";
I can't think of a scenario where I would a different sub-directory (apache alias) per system...
Thanks,