mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:33:47 +08:00
Autoload the cached PHP renderer
This commit is contained in:
parent
b67ae4c8a3
commit
8ec342f6cb
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue
Block a user