How do you organize your back-end file wise?
Posted: Thu Feb 05, 2009 10:35 pm
I read Pickle's thread though it was a bit more on classes and functions. I'm curious as how others organize their file structure.
If you're running Windows with DOS access to your web directory (start-->run-->type CMD-->type D: [enter]-->cd my\web\folder[enter]-->right click/mark, select with cursor, [enter], paste) to generate an easy copy and paste list.
In general I use a themes folder (since each theme has it's sub-folder) to cut down on unnecessary public root folders. With XP's Windows Explorer I organize by type and prefer things alphabetical. Also my site has a lot of functionality you can tweak (look at the tabs) otherwise a lot of the _2_ files would be condensed.
I know some people might like to condense lots of code in to very few files though I find that's a bit much for my taste. I've been adapting this to be as modular as I need so for example it's difficult in Version 2.8 to connect to the database without automatically setting the media type/mime where I've taken such things in to consideration. I'm not sure how much if at all I'll condense the files once this has matured.
Here is Version 2.9 Alpha 3's listing...
_0_header_00.php
_0_header_01_functions.php
_0_header_02_mysql.php
_0_header_02_mysql_authentication.php
_0_header_03_classes_01_cms.php
_1_functions_ajax_00.php
_1_functions_ajax_01_chat_01-activity.php
_1_functions_ajax_01_chat_02_list.php
_1_functions_ajax_01_chat_03_messages.php
_1_functions_ajax_01_chat_04_post.php
_1_functions_ajax_01_chat_05_exit.php
_1_functions_ajax_02_poll_01_poll.php
_1_functions_ajax_02_poll_02_results.php
_1_functions_ajax_03_registration.php
_1_functions_bb.php
_1_functions_file_system.php
_1_functions_permissions.php
_2_includes_01_xml.php
_2_includes_02_dtd.php
_2_includes_03_head.php
_2_includes_04_title.php
_2_includes_05_meta_00.php
_2_includes_05_meta_01_description.php
_2_includes_05_meta_02_keywords.php
_2_includes_05_meta_03_language.php
_2_includes_05_meta_04_robots.php
_2_includes_06_base.php
_2_includes_07_css.php
_2_includes_08_js.php
_2_includes_09_body.php
_2_includes_10_overflow.php
_2_includes_11_content_01_permissions_00.php
_2_includes_11_content_01_permissions_01.php
_2_includes_11_content_01_permissions_02.php
_2_includes_11_content_01_permissions_03.php
_2_includes_11_content_02_status.php
_2_includes_12_sidebar-00.php
_2_includes_12_sidebar-02-01.php
_2_includes_12_sidebar-02-02.php
_2_includes_12_sidebar-02-03.php
_2_includes_12_sidebar-03-news-archives.phpp
_2_includes_12_sidebar-03-news.php
_2_includes_12_sidebar-05-poll.php
_2_includes_13_overflow-end.php
_2_includes_14_prompt-00-tab-anchor.php
_2_includes_14_prompt-00.php
_2_includes_14_prompt-01.php
_2_includes_14_prompt-02.php
_2_includes_15_prompt-end.php
_2_includes_16_head.php
_2_includes_17_location.php
_2_includes_18_menu.php
_2_includes_19_head-end.php
_2_includes_20_footer.php
_3_template_01-1.php
_3_template_01-2.php
_3_template_02-redirect-1.php
_3_template_02-redirect-2.php
_3_template_02-redirect-3.php
_4_patch-tab-0.php
_4_patch-tab-1.php
_4_patch-tab-3.php
_4_patch-tab-4.php
In general this keeps me very well organized and I can easily adapt new files where I need. I'd like to see how others handle PHP and their file system in general, maybe share some nifty tips.
If you're running Windows with DOS access to your web directory (start-->run-->type CMD-->type D: [enter]-->cd my\web\folder[enter]-->right click/mark, select with cursor, [enter], paste) to generate an easy copy and paste list.
In general I use a themes folder (since each theme has it's sub-folder) to cut down on unnecessary public root folders. With XP's Windows Explorer I organize by type and prefer things alphabetical. Also my site has a lot of functionality you can tweak (look at the tabs) otherwise a lot of the _2_ files would be condensed.
I know some people might like to condense lots of code in to very few files though I find that's a bit much for my taste. I've been adapting this to be as modular as I need so for example it's difficult in Version 2.8 to connect to the database without automatically setting the media type/mime where I've taken such things in to consideration. I'm not sure how much if at all I'll condense the files once this has matured.
Here is Version 2.9 Alpha 3's listing...
_0_header_00.php
_0_header_01_functions.php
_0_header_02_mysql.php
_0_header_02_mysql_authentication.php
_0_header_03_classes_01_cms.php
_1_functions_ajax_00.php
_1_functions_ajax_01_chat_01-activity.php
_1_functions_ajax_01_chat_02_list.php
_1_functions_ajax_01_chat_03_messages.php
_1_functions_ajax_01_chat_04_post.php
_1_functions_ajax_01_chat_05_exit.php
_1_functions_ajax_02_poll_01_poll.php
_1_functions_ajax_02_poll_02_results.php
_1_functions_ajax_03_registration.php
_1_functions_bb.php
_1_functions_file_system.php
_1_functions_permissions.php
_2_includes_01_xml.php
_2_includes_02_dtd.php
_2_includes_03_head.php
_2_includes_04_title.php
_2_includes_05_meta_00.php
_2_includes_05_meta_01_description.php
_2_includes_05_meta_02_keywords.php
_2_includes_05_meta_03_language.php
_2_includes_05_meta_04_robots.php
_2_includes_06_base.php
_2_includes_07_css.php
_2_includes_08_js.php
_2_includes_09_body.php
_2_includes_10_overflow.php
_2_includes_11_content_01_permissions_00.php
_2_includes_11_content_01_permissions_01.php
_2_includes_11_content_01_permissions_02.php
_2_includes_11_content_01_permissions_03.php
_2_includes_11_content_02_status.php
_2_includes_12_sidebar-00.php
_2_includes_12_sidebar-02-01.php
_2_includes_12_sidebar-02-02.php
_2_includes_12_sidebar-02-03.php
_2_includes_12_sidebar-03-news-archives.phpp
_2_includes_12_sidebar-03-news.php
_2_includes_12_sidebar-05-poll.php
_2_includes_13_overflow-end.php
_2_includes_14_prompt-00-tab-anchor.php
_2_includes_14_prompt-00.php
_2_includes_14_prompt-01.php
_2_includes_14_prompt-02.php
_2_includes_15_prompt-end.php
_2_includes_16_head.php
_2_includes_17_location.php
_2_includes_18_menu.php
_2_includes_19_head-end.php
_2_includes_20_footer.php
_3_template_01-1.php
_3_template_01-2.php
_3_template_02-redirect-1.php
_3_template_02-redirect-2.php
_3_template_02-redirect-3.php
_4_patch-tab-0.php
_4_patch-tab-1.php
_4_patch-tab-3.php
_4_patch-tab-4.php
In general this keeps me very well organized and I can easily adapt new files where I need. I'd like to see how others handle PHP and their file system in general, maybe share some nifty tips.