From 2db663ca037fd749f9ba16bdec523cb9b5574651 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 16 Nov 2016 21:13:10 +0900 Subject: [PATCH] Fix #8 register autoloader for documentItem and commentItem --- supercache.controller.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/supercache.controller.php b/supercache.controller.php index 604974a..7dece75 100644 --- a/supercache.controller.php +++ b/supercache.controller.php @@ -95,6 +95,14 @@ public function triggerAfterModuleHandlerInit($obj) { $this->fillPageVariable($obj, $config); } + + // Register autoloaders for documentItem and commentItem, because some versions of XE fail to autoload them. + spl_autoload_register(function($class) { + if (preg_match('/^(document|comment)item$/', strtolower($class), $matches)) + { + include_once sprintf('%1$smodules/%2$s/%2$s.item.php', _XE_PATH_, $matches[1]); + } + }); } /**