[ic] Catalog self-test

Marc Brevoort marc.brevoort at armazemdedados.com
Thu Sep 25 09:32:54 EDT 2003


On Wed, 2003-09-24 at 19:08, Mike Heins wrote:
> Quoting Kevin Walsh (kevin at cursor.biz):
> > Mike Heins [mike at perusion.com] wrote:
> > > Quoting Marc Brevoort (marc.brevoort at armazemdedados.com):
> > > > Some of the catalogs that I developed would benefit from running a self
> > > > test. 
> > > > For example, checking for the presence of a certain stored procedure in
> > > > the database and creating it when not present.
> > > > Such a test would only need to be performed on catalog startup.

> > It could be added as a new site configuration directive, as follows:
> > 
> > interchange.cfg:
> > 
> >     GlobalSub <<EOS
> >     sub wrap_cataloginit {
> >         package Vend::Config;
> > 
> >         sub parse_cataloginit {
> >             my ($directive,$value) = @_;
> >             return undef unless $value =~ /yes/i;
> > 
> >             #
> >             #   the following is an example of how to get access
> >             #   to the site's configuration
> >             #
> >             ::logGlobal("vendroot=$C->{VendRoot}");
> >             1;
> >         }
> >     }
> >     EOS
> > 
> >     AddDirective CatalogInit cataloginit
> > 
> > catalog.cfg (at the end, when all other config is complete):
> > 
> >     CatalogInit Yes
> 
> Yes, that would work. I always seem to forget about AddDirective...when
> I wrote it I thought it would be used more often than it seems to be.
> > I have no idea whether database access would be possible with this
> > sort of setup - it would have to be tried and experimented with.
> I think you would have to just use DBI; without calling open_database()
> none of the IC stuff will work.
For checking the databases, DBI would be fine--The only other thing I
can think of right now are verifying settings of catalog.cfg and
variables.txt. Any issues to be expected with safe mode? If safe mode is
not yet enabled at this time, it should all be pretty straightforward.

Regards,

Marc Brevoort
-- 
e-mail:	marc.brevoort at armazemdedados.com
web:	http://www.armazemdedados.com

Armazem de Dados, Informatica, Lda
Dep. Desenvolvimento
Tel. +351 21 910 83 10 / Fax. +351- 21 910 83 19



More information about the interchange-users mailing list