Autoload the cached PHP renderer

This commit is contained in:
Toby Zerner 2015-08-26 09:46:20 +09:30
parent b67ae4c8a3
commit 8ec342f6cb

View File

@ -32,7 +32,6 @@ class Formatter
event(new FormatterConfigurator($configurator));
return $configurator;
}
@ -63,6 +62,12 @@ class Formatter
protected function getRenderer(CommentPost $post)
{
spl_autoload_register(function ($class) {
if (file_exists($file = storage_path() . '/app/' . $class . '.php')) {
include $file;
}
});
$renderer = $this->getComponent('renderer');
event(new FormatterRenderer($renderer, $post));