Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 899473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:13:23+00:00 2026-05-15T15:13:23+00:00

I’ve been trying a bunch of different directory structures for my PHP MVC framework.

  • 0

I’ve been trying a bunch of different directory structures for my PHP MVC framework. While doing this, I thought of a few reasons to separate different parts of the application from each other.

For instance, let’s say this is my current structure:

- index.php
- private/
    - application/
        - ... (MVC stuff. Irrelevant I think...)
    - config/
        - config.php
    - framework/
        - bootstrap.php
        - includes/
        - library/
            - ... (Framework classes)
    - libraries/
        - Zend/
        - PEAR/
 - public/
     - css/
     - images/

The way I have it, I can update the framework simply by overwriting the /private/framework/ directory, which won’t affect the user’s framework configuration in /private/config/, or the 3rd party libraries in /private/libraries/.

The /index.php file is used almost purely to load the /private/framework/bootstrap.php file, which will mean updating the /private/framework/ directory will also update the main bootstrapping file (Saving me from having to update the /index.php file, which will stay as is, as there’s not much at all in it).

Also, the application is separate from everything to do with the framework too, so the user can switch/change/update their applications when needed without having to worry about other directories.

Am I on the right track here with regards to separating the directories from one another to make them easier to update?

I’ve seen in some frameworks that they have both their /private/libraries/ and /private/application/ directories inside their framework directory… but this seems to me like it would be hard to update to a newer version of the framework if needed. Or am I thinking about it the wrong way?

You can see my previous dir structure here if you’re interested. My new one is a little different (hopefully better…), as is my question, so I thought it warranted the posting of a new question.

It’s not as small of a question as I would have hoped, but ah well! 😉

Thanks in advance =)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:13:24+00:00Added an answer on May 15, 2026 at 3:13 pm

    I would suggest separating framework code from application code. The framework should be under one top-level directory and the application under a different one.

    Actually… I suggest you look at the directory structure used by CakePHP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.