I have a main php file with a main class. Also in this class I do require_once ("func.php"); which has many useful features for my site.
The size of func.php is very large because there are many functions for different actions on different pages . But I include it on every page, because including one called by the main class. What do I need to do to optimize it?
Rewrite func.php in OOP and use something like "$ funcs-> my_func ()" in the main class? Will I win some work? Functions that were not called would not take up memory and processor time?
Or do I need to rewrite func.php for many files and call them on the specified page? For example: for "about.php" I will include "about_func.php" with the necessary functions. But this is not convenient, I think ...
Please help me :) And sorry for my eng :)
source share