From: Alex B. <en...@tu...> - 2001-07-10 18:20:17
|
> Typically I have some code that are executed on *every* page. An example > of this would be to connect to a database. I normally put them in an > 'include' file and include it in all the other pages. What other things do you put in this include? All database connections will be "managed" by querymanager, based on datasource definitions that live in user/conf/datasources.xml. At the moment, Querymanager doesn't exist in the sense that it is not integrated into the system - so you'd be best off putting some of that code in a library, and include it in a module. > Where would be the right place to have this "initialisation" code? > > I am thinking of putting it in a module, and call that module on every > page, then just make a global var for the db handle e.g. global $db; and > have my other modules access this $db. > > I somehow feel that this is not the right way to do it.... While r2 is in development, it is. When all the tools are hooked up, etc you won't want to do it that way, because it will be 100x easier to use QM. _a -- alex black, ceo en...@tu... the turing studio, inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 |