PHP Active Record implementation with a Rails-like API
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
htdocs
lib
models
scripts
tests
views
.gitignore
INSTALL
LICENSE
README.textile
bootstrap.php

README.textile

Documentation is available here.

What is FuzzyRecord?

FuzzyRecord is an Object-Relational-Mapping (ORM) system for PHP applications, based on the Active record design pattern, most famously used in Ruby On Rails. It has a friendly API leveraging some of the new features in PHP 5.3 behind the scenes.

What is FuzzyRecord not?

FuzzyRecord is NOT an MVC framework for PHP. It only provides a mechanism for storing an querying model objects (objects that store your application’s data).

Important note

FuzzyRecord should be considered a work in progress. Some features are incomplete, and it will contain bugs. The API is bound to change in some places in the future. Use at your own risk!

Requirements

  • PHP 5.3+ (Earlier versions are NOT supported)
  • PDO-MySQL and / or PDO-PGSQL
  • MySQL or PostgreSQL database server

Optional

  • Memcache PHP extension and server

Main features

  • Friendly Rails-like API (eg: $user→photos, User::find_by_email() etc)
  • Simple setup – many models will need no logic
  • Support for property validation (length, regex, email addresses etc)
  • File properties for storing files on a local disk
  • Handles relationships between objects, including cascade updates / deletes (currently one_to_many and belongs_to are supported)
  • Can be used with auto increment primary keys as well as non-integer and composite primary keys
  • Can cache model data in memory using a temporary store, and / or a persistent Memcached store
  • Explict or automatic transactions – rollback multiple actions accross the DB and cache stores
  • Can generate a DB schema from your models
  • Based on PDO for DB portability
  • Includes lots of unit tests

Coming soon

  • Better documentation
  • Write more tests
  • Many to many relationships without a joining table model
  • Full-text searching
  • Support for multiple find clauses with the same operator + field (eg: find_all_by_email_like_and_email_like())
  • Support for other databases (SQLite?)

Further future

  • DB-native foreign key constraints
  • Auto-generated admin system