mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Autoload the cached PHP renderer
This commit is contained in:
parent
bde590b5a6
commit
d07182622e
|
@ -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