Does this sound right to you?

I have my database handler as an include in many of my files, which are
in many different folders.  I test my work on a PC running Windows with
Apache, before uploading to the live site - so the environment is
different.

My database handler itself, has an include, to pull in the sitename,
database name, passwords, etc., for each individual site.  So using the
handler, with a different include(d) file for each site, means that
improvements to the handler can be passed on to all clients.  Elegant.

OK - so in main.php, I need to call db.php (database handler), which
itself calls site.php (site details).   

In my main.php (which could be in any folder, on any machine), I use:
include $DOCUMENT_ROOT . '/inc/db.php';

The database parameters are set in the constructor of the class, using
'include site.php'.  But it appears that the include is called relative
to db.php, not main.php, as is usually the case.   And anyway,
$DOCUMENT_ROOT appears empty within the class.

Does this sound right?  It works, but it 'feels wrong'.  And before I
deploy it Everywhere, I would appreciate some input...

-- 
Pete Clark

http://www.hotcosta.com
http://www.spanishholidaybookings.com




Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to