RedBeanPHP is an open-source ORM library written for PHP.
About
RedBeanPHP is open-source object-relational mapping software written in PHP.
The main proponent of this software is the configuration-less way that the software will create the tables and columns on-the-fly as you run your PHP code. It does this by working in a 'fluid' mode where the software will check for requested columns when the code is running and create them if they do not exist, it will even broaden the type of a column, for example if your application changes from storing numbers to text.
Once you are happy with your structure and do not want the data structure to change any further you can invoke the freeze command:
R::freeze( true ); //will freeze redbeanphp
This will lock your schema and prevent changes.
Setup & Using Redbean
RedBeanPHP is packaged up into a single php file (rb.php approx 285KB) so that a single include statement and you're ready to go:
require 'rb.php';
Working with Data
An example of CRUD operations with RedBean:
$post = R::dispense('post');
$post->text = 'Hello World';
$id = R::store($post); //Create or Update
$post = R::load('post',$id); //Retrieve
R::trash($post); //Delete
Database Compatibility
RedBean works with many database engines in fluid and frozen mode:
MySQL 5 and higher
SQLite 3.6.19 and higher
PostgreSQL 8 and higher
CUBRID (since 3.2)
Oracle* (since 3.3, read note)