note 22663 added to function.include

From: Date: Wed, 26 Jun 2002 12:02:54 +0000
Subject: note 22663 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-32217@lists.php.net to get a copy of this message
you can add the following code to your auto_prepend_file to add the document root to the include file: ------------------------------------------------- // add docroot to include path $old_path = ini_get('include_path'); $new_path = ereg_replace('\.:', ".:$_SERVER[DOCUMENT_ROOT]:", $old_path); $new_path = ereg_replace('\.$', ".:$_SERVER[DOCUMENT_ROOT]", $new_path); ini_set('include_path', $new_path); ------------------------------------------------- then you can store include files in the document root (i use $docroot/etc for config and $docroot/lib for functions). this directories can be protected via an .htaccess file, ie: ------------------------------------------------- AuthName "null" AuthType basic AuthUserFile /dev/null require valid-user ------------------------------------------------- note that this will work with virtual hosts (each one gets its own include path). -- http://www.php.net/manual/en/function.include.php http://master.php.net/manage/user-notes.php?action=edit+22663 http://master.php.net/manage/user-notes.php?action=delete+22663 http://master.php.net/manage/user-notes.php?action=reject+22663

« previous php.notes (#32217) next »