Project Equinox
The new word in social content management

Update of the day: 29/07/2014

Posts in This forum
OzzyD said on 13:24:17 29-Jul-2014

This feature to us is bigger than it sounds, chiefly because of the power it weilds and the scope for its developmental prowess and expansion within our system; particularly with that of not having to know how our system manages itself.

I best describe it well else that statement will be lost on all. Everyone who has even attempted to make a call to a database through Equinox will be all too familiar with the following line


In essence, get a variable defined in the list of Equinox's hooks. From there you can either pull


or another set of functions outlined in the db_repo class.

But what is there for scope of expansion of the db_repo class? Well, there's lots. Essentially all you have to do is write a new class in the class directory in Equinox's root and it gets loaded and implemented, so a new file could read something like

class myDatabaseHandler extends db_repo {

All is good right? All I have to do is go through the system and find out where db_repo is called and replace it with my own. And therein is the problem. Just where is it called? Well, at the time of writing this it's under site_config/db.conf.php as it's set up by the installer module, but what if I wanted to change this off the bat? The new implementation will allow us to.

There is a new definition directive going into Equinox 0.9 which works along the same method as the "use_display" define. "Use_display" is a large list of installed mods followed by which zone defined in the zoner that they're destined to be displayed. If there is no definition, it reverts to "*" else to "fallback-zone" if the destination zone does not exist.

This new definition is called "handlers" and lists a collection of strings to which the designated handler points. This means that instead of our call to db_repo looking like

equinox::hooks()->var->set("db_array", new Equinoxlibcoredb_repo);

it looks something like

equinox::hooks()->var->set("db_array", new $h['database']);

where our handlers have been taken out of the configuration system (equinox::hooks()->config->get_definition("...")) and placed into $h

Our new directive definition in our config file now reads

equinox::hooks()->config->define("handlers", array(
    "database" => "Equinoxlibcoredb_repo",

Which now means we can go into the configuration files and replace where the system looks for its database connection more easily than we could once before.

But, this is not its only use. I plan to make the permissions plugin run through this, along with various other plugins as they arise!

Thoughts please.


Information will appear here


Information will appear here


Information will appear here

Project Equinox The new word in social content management