ive created an mvc which has this level of organization as far as the folders and settings files go.
+[admin]
-[js]
-[css]
-[images]
-[classes]
--list of php classes
-[includes]
--config.php (includes db connection str
--functions.php (php functions)
--root---
[js]
[css]
[images]
[classes]
--list of php classes
-[includes]
--config.php (includes db connection str
--functions.php (php functions)
the problem i have with this structure is as you can see the administration section has its own folders of classes,functions, and a db configuration file.
then the root for other pages has its own set of pages for classes,functions, and db connection(which is the same as admin)
ive tried having only one folder for classes and another for includes and so on that the admin section and the root pages all share but the outcome of it becomes a mess of includes such as a spider web.
the method of including ive tried is
include_once(dirname(FILE)./directory/...) and what this does is if im inside of a folder and im trying to include a file that is one level up into the current page it wont work. and instead of it using the main root directory it includes the folder im inside as well. so that doesnt come to any good use.
so if this was my root: d:/wamp/www/website/ and i was including something from the main root into a file inside of a directory named functions the dirname(FILE) would actually have a value of d:\wamp\www\website\functions\
whats a good method of including files witout getting into a mess of errors trying to figure out whats going on.
thanks