Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Dealing with path names.

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  Woo-Hoo......  
Author Message
thumb_42

External


Since: Feb 20, 2004
Posts: 12



(Msg. 1) Posted: Wed Mar 17, 2004 7:14 am
Post subject: Dealing with path names.
Archived from groups: alt>www>webmaster (more info?)

What are some strategies you use in structuring paths?

Especially when it comes to PHP libraries, or files that really need to
be located outside of web space? CGI/PHP applications that are 3rd
party?

Here is my problem, and there seem to be dozens of ways of dealing with
it, but every one I've tried so far has resulted in a mess of paths
that are hard to traverse.

I've got a useraccount PHP application, planning on releasing it. A lot
of time went in to making it friendly to people who want to run multiple
copies of it. (I should tell you up front that I do plan on charging for
it, I don't want anyone to spend a whole lot of time thinking about this
question and then get angry later on, but I do want to give it to a few
people who are interested in testing it out.)

So, I've got:

$GLOBAL_LIB_DIR - Path to the application, nothing here should be
   modified or customized.

Then I've got:

$HOME/private_files - stuff that needs to stay out of web space
   any customization goes here.

Finally:

$WEB/wherever/the/webmaster/wants/in/*multiple*/directories.

The whole idea was that a webmaster could use it for multiple clients by
assigning different $HOME/private_files, an upgrade would be easy as
updating the central directory, changes to their client files (and
configurations) aren't touched and wouldn't get clobbered.

Well, that's the theory anyway...

Seemed like a great idea because it could simply check the
ownership of whatever php file was running and use that to locate the
right "private files" area.

The catch is, well.. this doesn't work for me (and I'm the idiot that
designed it!) because I need multiple copies as one user. One for
public, one for development, one for my own version of the website that
will support it. (I can easily work around it, but thought maybe I
wouldn't be the only one with the problem)

Is this the same type of problem a typical web master would run into? Do a lot
of you people use CVS for maintaining web sites?

Hard-coded pathnames are much easier to deal with (and more importantly
easier for someone trying to install this thing to understand!) But
they have other side effects, like making CVS management difficult.

How do you guys organize paths? Or rather, wish developers would
arrange pathnames? Is simply demanding that "such and such must be added to
your include path" sufficient?

Jamie<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Dealing with path names. 
Back to top
Login to vote
who

External


Since: Apr 29, 2004
Posts: 1010



(Msg. 2) Posted: Wed Mar 17, 2004 9:50 pm
Post subject: Re: Dealing with path names. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

<thumb_42.TakeThisOut@yahoo.com> wrote in message
news:3hQ5c.26865$JL2.310462@attbi_s03...
 > What are some strategies you use in structuring paths?
 >
 > Especially when it comes to PHP libraries, or files that really need to
 > be located outside of web space? CGI/PHP applications that are 3rd
 > party?
 >
 > Here is my problem, and there seem to be dozens of ways of dealing with
 > it, but every one I've tried so far has resulted in a mess of paths
 > that are hard to traverse.
 >
 > I've got a useraccount PHP application, planning on releasing it. A lot
 > of time went in to making it friendly to people who want to run multiple
 > copies of it. (I should tell you up front that I do plan on charging for
 > it, I don't want anyone to spend a whole lot of time thinking about this
 > question and then get angry later on, but I do want to give it to a few
 > people who are interested in testing it out.)
 >
 > So, I've got:
 >
 > $GLOBAL_LIB_DIR - Path to the application, nothing here should be
 > modified or customized.
The end user should be able to modify this. Reason being that different
setups require or allow different locations

 > Then I've got:
 >
 > $HOME/private_files - stuff that needs to stay out of web space
 > any customization goes here.
 >
 > Finally:
 >
 > $WEB/wherever/the/webmaster/wants/in/*multiple*/directories.
 >
 > The whole idea was that a webmaster could use it for multiple clients by
 > assigning different $HOME/private_files, an upgrade would be easy as
 > updating the central directory, changes to their client files (and
 > configurations) aren't touched and wouldn't get clobbered.
 >
 > Well, that's the theory anyway...
 >
 > Seemed like a great idea because it could simply check the
 > ownership of whatever php file was running and use that to locate the
 > right "private files" area.

On a shared hosting environment, that might not be such a good idea. If
SuExec is active it may work but what about where it is not.? There may be
only one instance of PhP used by all users, each with a different 'private
files' area. No way to tell from the permissions if the owner is nobody.


 > The catch is, well.. this doesn't work for me (and I'm the idiot that
 > designed it!) because I need multiple copies as one user. One for
 > public, one for development, one for my own version of the website that
 > will support it. (I can easily work around it, but thought maybe I
 > wouldn't be the only one with the problem)
 >
 > Is this the same type of problem a typical web master would run into? Do a
lot
 > of you people use CVS for maintaining web sites?
 >
 > Hard-coded pathnames are much easier to deal with (and more importantly
 > easier for someone trying to install this thing to understand!) But
 > they have other side effects, like making CVS management difficult.
Easier for the developer but not for the end user who has to install!
I prefer to use a set-up script which asks the installer (person) to enter
any required paths - directories etc then drop those into a db or write out
to the config file.


 > How do you guys organize paths? Or rather, wish developers would
 > arrange pathnames? Is simply demanding that "such and such must be added
to
 > your include path" sufficient?
 >
In an ideal world where all things are equal it would be. Unfortunately,
even where two machines are using the same packages and OS, it is often
found that the web dirs are laid out with local / sysadmin / contol panel
differences.

In a shared environment, which is where most hosted sites lie, a site using
your package will be one of many. The (php) include path is usually
generically outside the accessable part of a users space and it is unlikely
a sysadmin would look at placing files there for the user. Also, not all
systems are set up to allow .htaccess overide so you can put the include dir
within reachable space.

IMHO it is better to allow the end user to specify where goes what.


--
bildanet
MyLot.net - the home of the $10 reseller programme<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Dealing with path names. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Dealing with quotation marks in a PHP email form - I recently implemented a PHP email form on my site that works great, but I have this issue where if someone uses double or single quotation marks I get backslashes in the email. For example, if someone types in "I'm very bored" in the text area...
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]