[jdev] sm.xml configure

Norman Rasmussen norman at rasmussen.co.za
Tue Jun 26 06:12:45 CDT 2007


So I guess if Zhangmingjie is willing to do some compiling then the
required changes would be:

 - in storage.c : copy mysql as mysql1 in: init extern's,
driver_array, driver_inits
 - in storage_mysql.c : copy mysql_init as mysql1_init, and change
storage.mysql to storage.mysql1.

I doubt anything else needs altering to add a secondary store?

What makes more sense code-wise (now that I read it), would be adding
a 'config' attribute to the driver element, eg:

<driver config='mysql1'>mysql</driver>
<driver config='mysql2' type='vcard'>mysql</driver>

<mysql1>
 <host/><port/><etc/>
</mysql1>

<mysql2>
 <host/><port/><etc/>
</mysql2>

The config variable could be passed to the {driver}_init function, (or
if it's missing default it to NULL or the driver name).  Inside the
{driver}_init function you could access "storage." + config +
".variable".

On 6/26/07, Tomasz Sterna <tomek at xiaoka.com> wrote:
> Dnia 25-06-2007, pon o godzinie 23:45 +0200, Norman Rasmussen
> napisał(a):
> > what about adding an attribute to the driver config section which sets
> > the driver module name?
> > This should be a fairly minor change surely?
>
> Nope.
> I checked this before answering before. First idea was to just copy
> storage_XXX.so under different name.
> Config paths are hardcoded in storage modules, so mysql module always
> looks for 'mysql' config section.
>
> --
> Tomasz Sterna
> Xiaoka Grp.  http://www.xiaoka.com/
>
>


-- 
- Norman Rasmussen
 - Email: norman at rasmussen.co.za
 - Home page: http://norman.rasmussen.co.za/


More information about the JDev mailing list