Topic: Please explain the directory structure for this class (Read 1293 times)
Google dot what?
Posts: 2
16 credits Members referred : 0
« on: Aug 30, 2006, 11:12:39 PM »
I am an intermediate PHP MySql user and have a few applications under my belt - But nothing as sophisticated as the access software I downloaded from here.
I *ONLY* wish to run the sample scripts, so I have to install it as the defaults expect.. But I don't know how.
In the db_config.php file I have:
// use this pathes and/or define the pathes for the "standard" pages define("CLASS_PATH", dirname($_SERVER['PHP_SELF'])."/"); // the location where the class is executed $sec_path = "/home/mywebsite/public_html/access_user_class/"; // a second location where the scripts should be define("APPLICATION_PATH", $sec_path);
I know this is way off but I don't know what the author means by the "/classes/" directory or "second location? Am I supposed to MKDIR one? where?
What does he mean when he says some files need to be "ABOVE the DOCUMENTROOT? Like in the /home/ directory?? My DOCUMENT _ROOT is (I presume) /home/mywebsite/public_html/
All I get when running login.php or example.php is a white screen.
PLEASE help, somebody. I'm better off SEEING a sample dir structure from a linux OS... Can someone show me what this is suppossed to look like?
Helping me grasp this will be great karma for you - I'm desperate
« Last Edit: Aug 30, 2006, 11:28:49 PM by GaryM »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6439
39458 credits Members referred : 374
I'm new to webdigity and AU both. I love the concept (and existence) of the AU script, and I'm glad you figured out your path situation, but I'm still a bit confused. But then, I might be reading too much into this.
I believe your request for a directory structure is good. I would love to have one too.
I'm also confused as to why there is a "CLASS_PATH" and a "APPLICATION_PATH". I'm thinking that the brains of the application should be stored away from where the application is using it. I also read that as being "above your document root", which to me means "/home/domain/classes/", and not "/home/domain/public_html/classes/". I especially prefer to keep my sensitive variables outside the browser area.
Then there's the admin files, which I would think should be directory protected.
All that in mind, I'm seeing a directory structure such as this:
/home/domain/public_html/myapp/admin/ [dir protected] ... admin_user.php ... login.php ... test_access_level.php (not sure what this is yet)
Haven't figured out or looked at yet: ... activate_password.php ... deny_access.php ... ext_user_profile.php ... login_local.php
These are just document files for installation and use, correct? ... testpage.php ... access_user_doc.htm ... access_user_profile_doc.htm
Now I'm sure there are 50 ways to set this up, but please let me know if my structure here has something to be desired, and especially if some of my files are out of place.
My biggest concern is, when I separated out the admin file, it required the login file. So, I'm wondering if I need to replicate the files in the myapp folder, but then it would still use the same db_config, so I'm not sure of the ramifications of that.
Thanks for your ear.
« Last Edit: Oct 03, 2006, 06:45:00 AM by KDCinfo »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6439
39458 credits Members referred : 374
It's time to use PHP5!
« Reply #4 on: Oct 03, 2006, 08:28:46 AM »
Hi,
I work most of the time with three directories:
1 for the class 1 for admin 1 for the application
the only important path is the application path because this one is used in the email message.
all other pathes are just a matter of a right using of th include/require commands
Edit but start with that structure and tell us the settings from you config file.
the only important path is the application path because this one is used in the email message.
all other pathes are just a matter of a right using of th include/require commands
Edit but start with that structure and tell us the settings from you config file.
So it sounds like I'm on the right path Thanks.
My config path settings are:
$cls_path = dirname($_SERVER['PHP_SELF'])."/"; $sec_path = dirname($_SERVER['PHP_SELF'])."/useraccess/"; // dir protected define("CLASS_PATH", $cls_path); // the location where the class is executed define("APPLICATION_PATH", $sec_path);
But, I manually overwrote any file that's looking for "db_config.php", "access_user_class.php", or "session_handler.php" and pointed them to: /home/domain/classes/access_user_class/ [although mine are a bit renamed]
Seems to work on initial try, but wasn't certain about the remaining files. I'll keep reading your online help and doc files, and play around with it some more. Right now I think its more than what I was originally looking for, but its also evident that I'm going to grow right into it. You've done great stuff here!
Thanks.
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3901