07-07-2017, 08:48 AM
I've implemented autoloading classes, drop your class file into classes folder and away you go, see gist below which has a readme.txt and class.autoloader.php, just put the class file into classes folder, open init and remove all classes called with require_once() and in their place require the class.autoloader.php file:
thats it, classes will be required only when they are needed, we have only one require rather than multiple reducing overhead.
try it out by placing in the input class then visit a page with input fields, you'll see "Hoorah my class is included !" only where the input class is used.
https://gist.github.com/Firestorm-Graphi...5f7e5c8632
NOTE: chunk6.php is only for userspice installation files
Code:
require_once ABS_TR_ROOT.TR_URL_ROOT.'users/classes/class.autoloader.php';
thats it, classes will be required only when they are needed, we have only one require rather than multiple reducing overhead.
try it out by placing
Code:
bold("<br><br> Hoorah my class is included !");
https://gist.github.com/Firestorm-Graphi...5f7e5c8632
NOTE: chunk6.php is only for userspice installation files