[]RSS

About Archives Artwork Comic Contact Philosophy Projects Tags

CodeIgniter 1.7 released

[Comment]

October 23rd, 2008 in Links

Released today: CodeIgniter 1.7, an update to the handy-dandy PHP MVC toolkit. Includes improvements to sessions, form validation, URI processing, and much more.

Better rewrite rules for CodeIgniter

[Comment]

May 16th, 2008 in Links

A much better set of rewrite rules for CodeIgniter apps than the ones suggested by their docs. Use these rules, not the ones in the official docs, as these rules specifically exclude access to the library’s naughty bits, and more sensibly enable access resource-type files.

HOWTO: Set up a CodeIgniter project in Subversion

[Comment]

May 16th, 2008 in Micro Blog

After working with CodeIgniter for a few months (and WordPress for a few years), I’ve settled on a way to set up web projects that works well for development, deployment, and source control. Note that this style of layout only works on systems like Mac and Linux that have useful symlinks.1

First, the folder layout

some-domain.com/
    app/
        config/
        controllers/
        (etc)
    public/
        .htaccess           -> ../site-extras/.htaccess
        favicon.ico         -> ../site-extras/favicon.ico
        js/                 -> ../site-extras/js
        images/             -> ../site-extras/images
        system/
            application/    -> ../../app/
    site-extras/
         js/
         images/
        .htaccess

The layout favours a setup, and splits your code and resources out of the CodeIgniter sources. Splitting your stuff from the CodeIgniter stuff lets you link your Subversion repository to theirs, so that you can keep it in sync with their development.

How it’s done

  1. Set up your source tree (not including the symlinks or CodeIgniter source) and add to your Subversion repo.
  2. Add a svn link to CodeIgniter’s repo (via svn propedit svn:externals, with public http://dev.ellislab.com/svn/CodeIgniter/tags/v1.6.2/) and run a svn update to grab the framework. See the Subversion docs for details.
  3. Copy the CI application folder to the site root (as app), remove the .svn folders, symlink to application, and add it to your local svn repo.
  4. Symlink the other site-extras to the public webserver root, and configure your local machine (and public webserver) to point to this root for the domain’s virtual host setup.
  5. Alternatively, you can modify the $application_path to point to ../public/app/ (I’m not sure which is better yet). See the CodeIgniter docs on apps for more details.

You now have a CodeIgnitor project ready for development. You can keep up-to-date with CodeIgniter updates, deploy easily, and get at your code without wading through extra levels of hierarchy.

  1. I don’t think that Windows is suited for PHP/MySQL/Apache development anyway, as it’s more work to configure, harder to get packages for, and lacks things like SSH, symlinks, and useful shells. But that’s me.

PHP framework benchmarks

[Comment]

March 24th, 2008 in Links

A simple benchmark of CodeIgnitor versus CakePhp (and Symfony).1 While the timings describe a trivial amount of code, they show the basic cost of loading the frameworks.

  1. I hate typing out ‘Symfony’. It’s not clever, it’s not funny, it’s just spelled wrong