From 9b9ff136acf374434f10f1b0b8d18fdc6d17de43 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sat, 3 Feb 2018 20:21:13 +0100 Subject: Move autoloader for classes into pagelets.php This commit moves the "spl_autoload_register" function directly into the pagelets.php to reduce duplicate code within index.php and async.php. --- include/pagelets.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/pagelets.php b/include/pagelets.php index 62c3ed9..f6734e2 100644 --- a/include/pagelets.php +++ b/include/pagelets.php @@ -4,6 +4,14 @@ #=============================================================================== $DEBUGGING = TRUE; +#=============================================================================== +# Autoload register for classes +#=============================================================================== +spl_autoload_register(function($classname) { + $classname = str_replace('\\', '/', $classname); + require "classes/{$classname}.php"; +}); + #=============================================================================== # Check if BigPipe should be disabled #=============================================================================== -- cgit v1.2.3