|
 |
|
 |
04-08-2004, 08:15 PM
|
#1 (permalink)
|
|
Code Monkey
Join Date: Mar 2003
Location: Evansville, IN
Posts: 75
|
Organization of a Site
Hello,
Although I have been programming for a while (since middle school). I haven't gotten into web programming until recently. However, I haven't gotten into PHP until a few weeks ago. My previous ploys have been with perl. While good, I feel that if I want to be a better pick within the job field should I ever need to get a new job, I should learn how to use this.
So, now that I have wasted precious words on nothing important, here is my real question. How does one go about arranging their numerous script files for a semi-large site? There are a lot of things to think about with this, and I just wondered how other people organized themselves, so I could take hints. Maybe I should just use the same deal as with perl scripts, but the fact that one can include a header and footer makes it a little more complicated. I have authentication/session stuff that needs to go somewhere, and I feel as though I am bungling it up.
Thanks, look forward to your feedback,
Ted Morse
__________________
while(1) fork();
|
|
|
04-10-2004, 07:10 AM
|
#3 (permalink)
|
|
Code Monkey
Join Date: Mar 2003
Location: Evansville, IN
Posts: 75
|
Thanks for the input, however, while informative, I don't think that post was quite what I was going for. My question relates to the general layout (files w/ functions in folders) than the development process, even though that is easily read from my post.
Thanks for the interesting link though.
Ted Morse
__________________
while(1) fork();
|
|
|
04-10-2004, 08:13 AM
|
#4 (permalink)
|
|
Senior Contributor
Join Date: May 2002
Location: vta.ca.usa
Posts: 555
|
Depends, I suppose on your personal preferences. To give you an idea of how I arrange things, here's the general layout of a good sized project I've done...and by good sized I mean about 20 scripts.
A directory in the 'root' (the top level 'home' directory) that is in the 'include_path' directive and contain any scripts I wish to include, plus function declarations, and of course the 'classes' directory contains subdirectories with groups of related classes.
Code:
/php_inc
/php_inc/classes
/php_inc/classes/ClassX
The actual directory that's 'live' and available to the public, I've arranged like so:
Code:
projectname/
projectname/images
projectname/adm
So you can see I take a rather simplistic approach, but I try to do things by the KISS principal...keep it simple stupid! The more involved you get with creating separate directories for every little thing, the quicker you lose track, IMHO. Maybe others feel more organized if they create a new directory for each little component of the project...
HTH
|
|
|
04-10-2004, 11:07 AM
|
#5 (permalink)
|
|
Registered User
Join Date: Mar 2004
Location: Vancouver, WA
Posts: 7
|
Quote:
Originally posted by ender
My question relates to the general layout (files w/ functions in folders) than the development process, even though that is easily read from my post.
|
I was with you right up until the "if you'd read my question with both eyes, you'd have understood my request, jackass" portion. You'll fit into the developer community just fine - you've already got the RTFM mantra down.
|
|
|
04-10-2004, 01:50 PM
|
#6 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,489
|
wowzers .. heh
well i sorta do what bdl does ..
in my site directory, .. i have an 'include','images','classes' ( if i'm making the site OOP )..
it doesn't seem like one would really need more than that if you are using server-side scripting.
most large sites run off databases in which case the same scripts serves for hundres, or even thousands of pages.
you could make it appear like the end user is looking at a different directory for some content . sorta like how the tutorials section here on codenewbie is:
http://codenewbie.com/tutorials.php
but i use mod-rewrite to make it appear like tutorials is it's own subdirectory and each tutorial is its own html page.
http://codenewbie.com/tutorials/categories/
it make it appear more organized, but i do not really need that subdirectory for the content.
__________________
Mike
|
|
|
04-10-2004, 05:01 PM
|
#7 (permalink)
|
|
Code Monkey
Join Date: Mar 2003
Location: Evansville, IN
Posts: 75
|
xinu,
I did not mean to offend you at all, and I am sorry if I came off harsh or in a 'RTFM' sort of way. I seriously didn't mean to. However, I was trying to steer the thread away from a topic not intended.
Again, I am very sorry if I came off as a jackass, and will try to post more 'polite' responses in the future. Your input is very important and helpful.
Sde, Thanks a lot. I am currently builgin a rather small site for my CS Department Lab Admins, and since this is my first site using PHP, I figured I'd use the paradigm for script storage, function defining, etc. I think I might have solved my problems after actually thinking about them for a minute. But it is nice to know what other people do anyway, in case I come across other instances where something else might be appropriate.
Ted Morse
__________________
while(1) fork();
|
|
|
04-10-2004, 05:41 PM
|
#8 (permalink)
|
|
Registered User
Join Date: Mar 2004
Location: Vancouver, WA
Posts: 7
|
Quote:
Originally posted by ender
I did not mean to offend you at all, and I am sorry if I came off harsh or in a 'RTFM' sort of way.
|
(after re-reading the original reply)
Your reply looks fine after I've had 2 meals and have been awake 7 hours. You merely tried to shift focus back to site layout and mentioned that it's understandable that your original post might have been vague.
Sorry about that -- uggh.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 10:16 AM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|