Autoload the cached PHP renderer

This commit is contained in:
Toby Zerner 2015-08-26 09:46:20 +09:30
parent bde590b5a6
commit d07182622e

View File

@ -32,7 +32,6 @@ class Formatter
event(new FormatterConfigurator($configurator)); event(new FormatterConfigurator($configurator));
return $configurator; return $configurator;
} }
@ -63,6 +62,12 @@ class Formatter
protected function getRenderer(CommentPost $post) 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'); $renderer = $this->getComponent('renderer');
event(new FormatterRenderer($renderer, $post)); event(new FormatterRenderer($renderer, $post));