Re: including files outside of document root

From: Date: Wed, 23 Jan 2008 14:51:18 +0000
Subject: Re: including files outside of document root
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-267906@lists.php.net to get a copy of this message
Quoting Jason Pruim <japruim@raoset.com>:
On Jan 22, 2008, at 3:57 PM, Jason Pruim wrote:
Hi everyone, Been doing some reading on security and have decided that I should be storing my include files outside of the document root... Which I understand how to do it, but what I'm wondering, is say I write the Next Killer App (tm). How would I port that code easily off of my server and put it into a downloadable file for the millions of people who will download and run the Next Killer App (tm)? Err... That doesn't make it very clear... Is there a program for Macintosh or Unix that I could use to grab all the source code from where ever I have it set? Or would I need to make my own? Or should I just quit being lazy and grab it my self? :)
Yes I know I'm answering my own post... :) Thanks for all the suggestions that I received! It's helped me figure out some of the stuff, and now I just need a project to test some of the stuff with! Oh, and for an IDE I discovered that Apple XCode works very well as a php editor and file management system. Looks like it will work perfectly! I do have 2 questions though... #1. When including files outside of the webroot do you need to specify the entire path? Like for me, that would be something like: "/volumes/raider/webserver/includes/projectname/includeme.php" or can I just stop at: "/webserver/includes/projectname/includeme.php"?
It depends. If you set your include_path to /webserver/includes (outside your webroot) Then you can include the files like include "projectname/includeme.php"; If the files are not in your include_path you either need to provide the full path. Or set the include path in your application and go from there.
#2. Anyone got any small programming jobs that I can hone my skills with? :) You know, the kind of projects that you guru's don't want to do because you're too busy writting the Next Killer App (tm) but would be perfect learning experience/easy way to put some cash in the pocket? :)
Can't help you with this one :)

« previous php.general (#267906) next »