diff options
-rw-r--r-- | async.php | 11 | ||||
-rw-r--r-- | include/pagelets.php | 8 | ||||
-rw-r--r-- | index.php | 11 |
3 files changed, 8 insertions, 22 deletions
@@ -10,17 +10,6 @@ function isAsyncRequest() { # <<< -#=============================================================================== -# Include classes and functions -#=============================================================================== -spl_autoload_register(function($classname) { - $classpath = 'include/classes/%s.php'; - $classname = str_replace('\\', '/', $classname); - - require_once sprintf($classpath, $classname); -}); - -// Outsourced to avoid duplicate code in index.php and async.php require_once 'include/pagelets.php'; ?> <!DOCTYPE html> diff --git a/include/pagelets.php b/include/pagelets.php index 62c3ed9..f6734e2 100644 --- a/include/pagelets.php +++ b/include/pagelets.php @@ -5,6 +5,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 #=============================================================================== if(isset($_GET['bigpipe']) AND $_GET['bigpipe'] === '0') { @@ -1,15 +1,4 @@ <?php -#=============================================================================== -# Include classes and functions -#=============================================================================== -spl_autoload_register(function($classname) { - $classpath = 'include/classes/%s.php'; - $classname = str_replace('\\', '/', $classname); - - require_once sprintf($classpath, $classname); -}); - -// Outsourced to avoid duplicate code in index.php and async.php require_once 'include/pagelets.php'; ?> <!DOCTYPE html> |