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 6023573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:01:31+00:00 2026-05-23T04:01:31+00:00

I am building a PHP CMS from the ground up. There is one super-core

  • 0

I am building a PHP CMS from the ground up. There is one super-core file within my system which I currently have automatically importing all other packages and classes that make up the core of the system. On a typical page, only a few of these classes and methods are used.

Considering the load require_once() puts on a server to include all of these files, and the time a user must wait for the page to load, I am wondering which path I should take:

  1. Keep the super-core as-is and automatically include all of the system core for each page that includes this core file.
  2. Use the super-core to include only essential packages, such as database management, and import additional packages/classes on an as-needed basis.

Could someone please let me know which of the two options are the best, as well as a brief overview of its pros and cons?

Thank you for your time!!!

  • 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-23T04:01:32+00:00Added an answer on May 23, 2026 at 4:01 am

    Earlier this year, I came upon this exact problem while developing a framework in PHP.

    I considered the pros-cons and here’s my evaluation:

    Option 1 – Front Controller Pattern script include all other scripts

    Advantages

    • Inclusion of packages are done within one script; you can see what files are included what are not at one glance.
    • Inclusion of a particular package is always called once, there is no overhead.

    Disadvantages

    • Consider the case of such:

    We have two classes Rectangle and Shape. Rectangle is a child class i.e. extension of Shape. However the core script includes the classes alphabetically. Thus when Rectangle is included, Shape is not found and PHP will throw an error.

    Rectangle class:

    class Rectangle extends Shape{
    
    }
    

    Shape class:

    class Shape{
    
    }
    
    • more overhead when everything that is not needed is also loaded into the memory.

    Option 2 – Load main packages, then load other packages as-needed

    Advantages

    • Files are only included when needed. Reduces overhead in another way
    • Solves the problem mentioned in Option 1.
    • You are able to concentrate on what each package requires from other packages and simply just load them

    Disadvantages

    • Overhead as multiple requests for a particular package may occur.
    • Package inclusion is done in every single file.

    Programming code is for human. Therefore to make things more logical and breaking down the problem, I chose option 2 to go for the framework.

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

Sidebar

Related Questions

I'm building a CMS in PHP and one dread I have is that the
I have a small situaton here. I'm building a custom CMS for one of
I am building a php+mysql site which will have numerous articles. I am pretty
I am currently building a PHP application using the MVC pattern. I have implemented
I'm building a PHP page with data sent from MySQL. Is it better to
I'm building a small CMS in PHP for a client and something I've noticed
I'm building my personal CMS and need your advice organizing core functions and classes.
In a CMS I'm building I want to have my own javascript namespaced object
I'm currently building a little CMS for a smaller site. Now I want to
I'm building a CMS on a SaaS principle. I have my webserver (dynamic dedicated)

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.