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:
- Keep the super-core as-is and automatically include all of the system core for each page that includes this core file.
- 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!!!