Author Topic: vlibIni.php Q.  (Read 914 times)

0 Members and 1 Guest are viewing this topic.

RNilsson

  • Guest
vlibIni.php Q.
on: Sat, 09. November 2002 - 17:46:34
Does the Template-dir and Cache-dir work with variables like $_SERVER['DOCUMENT_ROOT'] ?

IE: 'TEMPLATE_DIR' => $_SERVER['DOCUMENT_ROOT'] . '/styles/templates'

Just curious...

releasedj

  • Guest
vlibIni.php Q.
Reply #1 on: Sun, 10. November 2002 - 12:05:05
Yes, you can change it to be any php variable.

The vlibIni.php file is included using include_once and not read in using the file functions, therefore, any php functionality can be entered into the file and will work as expected.

Regards,

Kelvin

RNilsson

  • Guest
vlibIni.php Q.
Reply #2 on: Sun, 10. November 2002 - 14:10:58
Perfect...

I assume that '../../config.inc.php' will work also?
Else i just put it in a var in the top of the ini-file...

Tnx.

releasedj

  • Guest
vlibIni.php Q.
Reply #3 on: Sun, 10. November 2002 - 17:09:08
Yes, but remeber that when you include using relative paths in PHP, it assumes that you're starting location is the first file called.

So you would need to use the __FILE__ variable with the dirname() and realpath function, i.e.:
realpath(dirname(__FILE).'/../../config.inc.php');

Regards,

Kelvin

RNilsson

  • Guest
vlibIni.php Q.
Reply #4 on: Mon, 11. November 2002 - 03:59:35
Yep, but i'm cheating a bit, i include my own site-wide config-file and use the same variables as for the rest of my scripts =)

i got among other stuff, docroot, base, cache and templatedir etc.

But tnx for the info.