Re: Making includes easy.... Am I a 'tard?
| From: | Jason Barnett | Date: | Tue, 04 Jan 2005 21:41:28 +0000 |
| Subject: | Re: Making includes easy.... Am I a 'tard? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-25228@lists.php.net to get a copy of this message | ||
I haven't bothered to benchmark this, but here is my own solution to this problem. If you already have a common file that you are including in every script then the cost should be very low. Feel free to use it if you prefer.
Apache
htdocs
site1
includes
common.php
test_include.php
testfolder
test2.php
site2
includes
(those four files)
etc...
<!-- common.php -->
<?php
$basedir = dirname(__FILE__) . '/';
?>
<!-- test_include.php -->
<?
include_once common.php;
/** Now you can include files relative to the base directory */
include_once $basedir . 'testfolder/test2.php';
?>
--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2