Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pokeb/fuzzy-record

PHP Active Record implementation with a Rails-like API
https://github.com/pokeb/fuzzy-record

Last synced: 2 months ago
JSON representation

PHP Active Record implementation with a Rails-like API

Awesome Lists containing this project

README

        

Documentation is available "here":http://allseeing-i.com/FuzzyRecord.

h3. 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.

h3. 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).

h3. 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!

h3. Requirements

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

h3. Optional

* Memcache PHP extension and server

h3. 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

h3. 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?)

h3. Further future

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