PHP Object Framework (PHPOF)
This page is about PHPOF2. For the original PHPOF (version 1), see the PHPOF1 pages.
What is PHPOF?
PHPOF is an object-oriented database access layer for PHP 5. It performs object-relational mapping (ORM) to make using SQL databases easier and more intuitive in PHP. Like this:
mysql> create table widgets(id int unsigned primary key auto_increment, name varchar(20) not null, description text, image blob, image_mime_type varchar(20));
<?php
require_once 'PHPOF2/DB.php';
require_once 'PHPOF2/DBTable.php';
$DB = PHPOF2_DB::factory('mysqli://foo:password@foohost/somedb');
$widgets = new PHPOF2_DBTable($DB, 'widgets');
$widget = $widgets->createRowObject();
$widget->name = 'foo';
$widget->description = 'Some long text';
$widget->store();
Key features
- Object-relational mapping (ORM)
- Automatic table detection
- Database abstraction (via MDB2 - currently supports MySQL but it's very easy to add support for other backends supported by MDB2)
- Elegant and efficient binary (BLOB) handling
- Integrated audit logging capabilities
- Installable via the PEAR installer
- Free software, licensed under version 3 of the Lesser GNU Public License (LGPL).