Posted (Updated ) in PHP

While aimlessly browsing my Twitter feed last night, I came across this tutorial on using CodeIgniter‘s Zip class. Kohana 3.1 doesn’t seem to come with similar functionality out of the box (at least from the brief glance I took), so I figured I’d write up a quick patch to get CI’s class working with it.

Download the module with example controller and test files here.

You can read up on how to use the class in CodeIgniter’s documentation or the tutorial linked to above. I’ve included a controller and 2 test files in the download above as a kind of ‘quick start guide’. To access them simply go to /koziptest and /koziptest/invalid for a successful and unsuccessful download respectively.

There isn’t really any more to say about this one other than the fact that I made the methods in my module chainable for convenience and consistency with other Kohana classes. Note that this means the read_file, read_dir and archive methods will now throw exceptions if you use an invalid file/directory path or your input or output files aren’t readable/writable – so remember to use a try..catch block! I’ve also made the download method take a Request variable as its first argument – simply pass your controllers current request to it like so:

$Zip->download( $this->response )

Read More »

Posted (Updated ) in PHP

Out of the box, CodeIgniter only supports MVC. This tutorial explains how to add HMVC to CodeIgniter by installing BackendPro 0.6.1 into a Multi-Site CodeIgniter 1.7.2 installation for some nice, modular goodness.

Read More »

Posted (Updated ) in PHP

By default, CodeIgniter only allows segment-based URLs, however it is also possible with a little fiddling to use querystrings and even to make the change application-wide or controller-specific.

Read More »

Posted (Updated ) in PHP

CodeIgniter is an incredibly powerful and easy to use PHP Framework that makes developers’ lives alot easier. In its default configuration it only supports one site per installation – quickly result in thousands of files on your file server which can be a pain for all involved. With a little fiddling we can fix this.

Read More »