A CodeIgniter active record library for MongoDB

This evening I started work on an active record inspired library for interacting with MongoDB via a CodeIgniter library.

So far I’ve got searching and inserting working. Updating and deleting are going to take more time because they’re a bit trickier.

What this means is you can easily work with a database collection like so:

$this->mongo_db->where_gte('age', 18)->where(array('country' => 'UK', 'can_drink' => TRUE))->get('people');

Or:

$this->mongo_db->get_where('posts', array('title' => 'Hello, World!');

Or just:

$this->mongo_db->get('sales');

I’ve created a repository on Bitbucket located at http://bitbucket.org/alexbilbie/codeigniter-mongo-library. If you have a look at the README file there is an overview of what is there so far and also what needs doing (and some maybes!).

Hope people find it useful.

Install PHP and MySQL on Redhat Enterprise Server 5.5

This post is more for personal reference as I couldn’t find anything definitive online for installing PHP and MySQL on RHEL5.5 easily.

sudo -s
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

yum update

yum install php php-devel php-mysql php-gd php-imap php-xml php-odbc  php-mssql

Hopefully someone else will find this useful