Re: including files outside of document root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 22, 2008 8:48 PM, Richard Lynch <ceo@xxxxxxxxx> wrote:
> On Tue, January 22, 2008 7:17 pm, Daniel Brown wrote:
> >     You may disagree with me on this here, Rich, but the way I do it
> > is to have a single include_files.php file containing all of the files
> > that need to be included as a whole, and a single configuration
> > variable to set where those files are located.  I know that they don't
> > all have to be included in that file, but I find it makes it easier,
> > since I use all of them with every page load.
>
> Can I put that include_files.php outside the web-tree as well?
>
> Or is the rest of your application bypassing include_path to force it
> to be inside the web-tree?

    Yes, the include_files.php file can be put anywhere.  I leave it
in the web tree, but it certainly doesn't have to be kept there.

> >     I also employ a function safe_include($filename) that uses a
> > combination of file_exists($filename), is_file($filename), and
> > is_readable($filename).  If the function fails, no PHP error message
> > is output if the file can't be found, and the script doesn't
> > necessarily halt.  If it's a critical file, instead a message is
> > dispatched to my email, and a friendly message is placed on the site
> > informing the user that a technical error has been encountered and
> > will be repaired ASAP.
>
> This sounds nifty for your own clients, but I don't think it would
> work well for, say, BB or Cake or phpMyAdmin...

    No, that's for proprietary, single-production systems, and the
systems won't be reused.

> I'm pretty sure the authors of those don't want an email from every
> broken install... :-)

    You got that damn straight!  ;-)

-- 
</Dan>

Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since
Nineteen-Seventy-[mumble].

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux