Greetings. I have here two patch files for CodeIgniter, one bug fix and one “improvement” (relative term, I know)
Both patches also include relevant doc changes.
Both patches are run against 1.6.1, as that is what I have.
To apply, be in base CI folder (containing system, user_guide, and index.php) and run `patch -p0 < file.patch`. If this doesn’t work, you should apt-get patch. If you don’t have a *nix-based system, you should install Linux.
================================================================================
cache_headers.patch:
================================================================================
This fixes the fact that headers aren’t cached along with the rest of a page. I noticed that the source mentioned that this would be a feature that should be fixed, and took the liberty.
————————————————————————————————————————
Notes:
————————————————————————————————————————
* This will change the cache files, but due to the way that caching is currently implemented, they should be regenerated automatically.
* Only headers set with the output->set_header() function will be cached. This should be a good thing, as it will allow users to set a header with a straight header() call to avoid caching certain headers. Perhaps we could come up with a second argument to set_header() in the future; a boolean of $cache?
* The cache files are brittle—if a user hand edits them and adds a space in the wrong spot, or saves with \n\r line endings, a PHP error will occur.
* On the other hand, the cache files are unsurprising, and can be hand edited easily, if wanted.
================================================================================
uri_suffix.patch:
================================================================================
This function allows you to use arbitrary URI suffixes. Any 1-5 characters following a period are stripped from the end of the URI, and saved as the suffix. This could allow URI suffix based content negotiation, as Rails currently supports.
————————————————————————————————————————
Notes:
————————————————————————————————————————
* I didn’t take the time or initiative to make this configurable, it will always be on.
* The uri_suffix config line will still always be added to the end of CI-generated URIs.
* The URI suffix is now used to generate cache file names, because if you are serving two separate files for .html and .rss suffixes, you will want each to have its own cache file.
* This should not be implemented without caching headers, as the main usage (filetype negotiation) will require different headers to be send depending on the URI suffix.