note 106631 deleted from function.get-include-path by thiago
| From: | thiago@php.net | Date: | Mon, 28 Nov 2011 11:38:45 +0000 |
| Subject: | note 106631 deleted from function.get-include-path by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-184708@lists.php.net to get a copy of this message | ||
Note Submitter: vukoxx at gmail dot com
----
@jcwebb
Adding '/' to your include path is probably not a good idea.
i've just tried it and i don't like it
<? include('etc/passwd'); ?>
Maybe you're better off by adding
<? set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__)); ?>
but that one would point to subdirectories as well
you can also add
<? set_include_path(get_include_path().PATH_SEPARATOR.$_SERVER['DOCUMENT_ROOT']); ?>
to your path, but you cannot rely on that one either (see Apache2/mod_vhost_alias)
i don't know what's best practice, but i strongly suggest to leave root out of your path.
My suggestion is to do it manually
<? set_include_path(get_include_path().PATH_SEPARATOR.'/var/www/explicit/path'); ?>
Regards, vuko.