Archive for the ‘frameworks’ Category

PHP Autoload Classes Recursively

This method will autoload any directory of class files recursively, in under 10 lines of code. This only works with 5.3.1+.

spl_autoload_register(function($class){
$rdi = new RecursiveDirectoryIterator(’/path/to/lib’);
foreach(new RecursiveIteratorIterator($rdi) as $file => $meta) {
if(($class . [...]

CodeIgniter ModRewrite for Dreamhost

Recently I began diving head first into CodeIgniter, a PHP MVC framework. During the installation process I ran into a major problem with URL rewriting within the CodeIgniter environment and Dreamhost.
CodeIgniter provides an .htaccess solution to create friendly URLs. Which in most cases works very well. However, with Dreamhost this solution does not work. The [...]