Modular eXtensible Information Modeler (MoXIM) classes for PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


The Modular eXtensible Information Modeler (MoXIM) is a database
structure and servicing layer that creates a balance between
performance and flexibility.  It can be implemented as a wrapper
around an existing database to create dynamic relationships.

The original XIM (see link below) was a purely relational database
that essentially had no predefined structure, which simulated a
schema-less database.  All "nodes" and the relationships between
them were stored in very large tables.  Node types and relationship
types were dynamically generated, making it extremely flexible.

MoXIM uses a hybrid approach, blending the flexibility of a schema
-less database and the performance of a database with a fully defined
schema.  MoXIM's "modules" are simply the tables with schemas that
can have primary/foreign key relationships between them, as "usual".
MoXIM allows for additional relationships to be created dynamically
without altering the schema of the existing tables.

See MoXIM_Database_Layout.pdf for an example MoXIM database layout.

moxim-php provides a PHP service layer for a MoXIM-ized database:

For more information about the original XIM:

   1. Copy the 'lib' directory to your webserver. You may rename this
   directory: "moxim" or "moxim-php" is recommended.

   2. As the above files should only be included, it is recommended
   you prevent a web client from accessing them by storing them
   in a private directory or set permissions accordingly.

   1. Include the 'config.php' file in every file you need to use
   MoXIM.  Alternatively, you may copy its contents into your own
   include file, as its only purpose is to load moxim-php classes.

   2. Instantiate a service by calling <ServiceClass>($o), where $o
   is an object that defines the data provider information.

   require_once 'config.php';

   $o = new stdClass();
   $o->driver = 'pdo/mysql'; // Name of driver
   $o->dbname = 'moxim'; // Name of MySQL database
   $o->username = 'username'; // Username for MySQL database
   $o->password = 'password'; // Password for MySQL database

   $svc = new MoXIM\services\BaseService($o);
   $m = new MoXIM\models\Module();
   $m->name = 'myTable';