Re: Require() using relative path
| From: | Jonatan Bagge | Date: | Wed, 08 Nov 2000 10:10:17 +0000 |
| Subject: | Re: Require() using relative path | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24290@lists.php.net to get a copy of this message | ||
What I do is simply including a common_vars.php3 file, where I specify a
"$templates_dir" then I can use it on all pages.
And then I just use a different common_vars.php3 file on different servers.
Doesn't help for Magic_quotes though
Jonatan Bagge
Ryan Adams wrote:
> Ah yes. That will work.
>
> The question is still alive in my mind, however, from a portability standpoint.
> For instance, I would like to be able to easily port the code to any server
> that is running php4 and not require server changes. Part of this includes
> explicity setting variables like magic_quotes and whatnot in a header file.
>
> Is it also possible to set include_path in that manner?
>
> Thanks,
> Ryan
>
> On Tue, Jul 25, 2000 at 08:28:31AM -0700, Rasmus Lerdorf wrote:
> > Just add the templates directory to your include_path and you can do that.
> >
> > -Rasmus
> >
> > On Tue, 25 Jul 2000, Ryan Adams wrote:
> >
> > > Man, I'd like to see something like this too. I'm working on a reporting
> > > system that includes files with includes in them, across several directories.
> > > It would be really nice to have a function that did it automatically...
> > >
> > > Would that go against the current architecture? How are includes/requires
> > > currently implemented?
> > >
> > > Ryan
> > >
> > >
> > >
> > > On Wed, Jul 19, 2000 at 05:37:07PM +0800, Ken M. Mevand wrote:
> > > > hi folks,
> > > > i'm just starting to program in php, so please forgive me if this
> > > > question is dumb.
> > > >
> > > > here is my file layout :
> > > >
> > > > index.php
> > > > |- templates
> > > > | |-default.php
> > > > | |-welcome.php
> > > >
> > > > i called index.php which includes default.php, which in turn includes
> > > > welcome.php. can the 2nd include in default.php be done using
> > > > require("welcome.php")
> > > >
> > > > instead of
> > > > require("templates/welcome.php") ?
> > > >
> > > > -ken
> > > >
> > > >
> > > >
> > > > --
> > > > 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
> > > ---end quoted text---
> > >
> > >
> ---end quoted text---
>
> --
> 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