Ok, i am new to this and i'm trying to make a real simple project just to test my ability. I just came up with this schema in mind and i don't really know if it's a pattern or something and i'd like to get some suggestions about it and how to improve it.
index.php # This manage the $_GET['page'] var and load some basic stuff
app/ # Here's the logic part, the pages included 开发者_运维知识库in index.php, they do some stuffs and then call templates to output the HTML page
config/ # Here we put some configurations file such as database.con.php or board.con.php which contain an extension or the array $cf
lang/ # Same way of configurations, we have something like en.lang.php or it.lang.php and inside there is an array called $lang
lib/class/ # Contains all the classes
lib/set/ # Contains sets of functions, such as error.set.php or file.set.php
theme/ # Contains template file that got called from app files
Will i stuck with this schema? Is there anything that can be improved/changed?
Is your document root (for the webserver) in app, or are we looking at it? Looks like you might already know this but you should consider keeping folders like lib and config out of your document root.
That looks alright.
Keep in mind that you should name and place your classes in a way to facilitate auto loading.
It'd also be useful keeping everything but index.php
and theme/
(if it contains assets such as CSS/JavaScript/images) above the document root.
精彩评论