Skip to content

Commit

Permalink
Fix #8 register autoloader for documentItem and commentItem
Browse files Browse the repository at this point in the history
  • Loading branch information
kijin committed Nov 16, 2016
1 parent 4108ec2 commit 2db663c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions supercache.controller.php
Expand Up @@ -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]);
}
});
}

/**
Expand Down

0 comments on commit 2db663c

Please sign in to comment.