RE: [PHP] Re:[PHP] not so happy with include()
| From: | Kurt Lieber | Date: | Mon, 08 Oct 2001 02:32:13 +0000 |
| Subject: | RE: [PHP] Re:[PHP] not so happy with include() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70313@lists.php.net to get a copy of this message | ||
How about:
define('DIR_INCLUDES', 'path/to/my/includes/')
and then use something like:
require ($DOOCUMENT_ROOT . DIR_INCLUDES . "adm/admin.php"); //untested,
off-the-cuff code
I encourage you to look at the source code for The Exchange Project
(theexchanceproject.org). They're using includes extensively for all
functions, classes, etc. and have a well-designed, well-laid out system.
(IMO) Should provide some inspiration.
--kurt
> -----Original Message-----
> From: Christian Dechery [mailto:cdechery@easynet.com.br]
> Sent: Sunday, October 07, 2001 5:37 PM
> To: bojan@inet.co.yu
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Re:[PHP] not so happy with include()
>
>
> this doesn't solve my problem... I tought of that...
>
> what if someone gets my system and install it under /whatever
> instead of
> /vitrine...??? then NO include at all will work?
> I need relative includes that will work regardless of the dir
> in which my
> system is under the webroot... that is the problem...
>
> but thanks anyway... I'll keep trying something ( haven't
> come up with a
> thing so far... :( )
>
>
> >require ("$DOOCUMENT_ROOT/vitrine/adm/admin.php");
> >
> >HTH,
> >Bojan
> >
> >Christian Dechery <cdechery@easynet.com.br> wrote:
> >
> > >I'm working in quite a BIG system in PHP now... I have up to 6
> > >.inc.php (library files) so far...
> > >
> > >I have the following directory tree..
> > >
> > >/vitrine (main program files)
> > >/vitrine/include (include dir, where the .inc.php resides)
> > >/vitrine/adm (the administration panel, with login etc...)
> > >
> > >the problem is that within the files in /adm I do some
> requires() and
> > >includes()... and within the .inc.php's also... so I'd
> have something
> > like...
> > >
> > >/vitrine/adm/admin.php
> > ><?
> > > require("../include/lib.inc.php");
> > > require("../include/error.inc.php");
> > > // etc...
> > >?>
> > >
> > >/vitrine/include/lib.inc.php
> > ><?
> > > require_once("../include/db.inc.php");
> > > // etc...
> > >?>
> > >
> > >this works fine when I am at /adm... but once I move to
> /vitrine none
> > >of the includes-within-includes works because of the
> relative dirs...
> > >I can't use include_path cuz I don't have access to
> php.ini... what
> > >do I do???
> > >
> > >_____________________________
> > >. Christian Dechery
> > >. . Gaita-L Owner / Web Developer
> > >. . http://www.webstyle.com.br
> > >. . http://www.tanamesa.com.br
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > >For additional commands, e-mail: php-general-help@lists.php.net To
> > >contact the list administrators, e-mail:
> php-list-admin@lists.php.net
> > >
>
>
> _____________________________
> . Christian Dechery
> . . Gaita-L Owner / Web Developer
> . . http://www.webstyle.com.br
> . . http://www.tanamesa.com.br
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-general-help@lists.php.net To contact the list
> administrators, e-mail: php-list-admin@lists.php.net
>
>