[ NOCTERNITY ]
Postgres object cache
Projects
Goal
This project is meant to replace the PHP interface that comes with
Dia2Postgres ; while it was originally started using PHP 4,
the messy OO interface made it impossible to continue without switching to PHP 5.
It consists in a set of classes to be loaded and initialized whenever a session is started,
be it a new session or an already existing session. Those classes allow the programmer to define
classes that mirror tables from a Postgres database.
Each instance of these classes is able to access to a single row and allows the user
to read and modify rows directly through an instance's properties.
Requirements
The final version should offer the following features :
-
as transparent as can be done : the user shouldn't be bothered with long initialization
calls ; in the same spirit it should be easy to define a class linked to a database table.
-
support for complex relationships : the user should be able to use both Postgres and
Dia2Postgres inheritance rules, as well as using foreign keys.
-
support for transactions : by default all the actions would be executed inside a single
transaction ; it would be possible to commit or roll back the current transaction at any time,
thus reseting the objects' status.
-
support for callbacks : it should be possible to mark an object to be kept under surveillance
and have specific code executed in case some event affects its data ; different events such as
deletion, row modification or cell modification should be available, and multiple handlers might
be present for the same event.
Status
IMPORTANT NOTE: this project is still in its early stages. DO NOT use it in a production
environment. For now, please avoid reporting bugs, since the code you are talking about may disappear
at any time.
-
A first set of tests were run using PHP 4. Those tests led to the conclusion that PHP 4's OO support
is far too unreliable for this project.
-
A new version has been written using PHP 5 ; it has complete support for foreign keys and intermediary
tables. Unfortunately, it has been written as a part of the future Nocternity web site. The code
is currently being modified so that it may be used independently.
Files
-
PHP 4 tests: some parts are missing, it's quite unusable and
it tends to crash the PHP interpreter. A lot. You have been warned.
-
ObjCache v0.1 (ALPHA) will be available once
I'm done extracting it from the new site's code.