1
0
mirror of https://github.com/flarum/core.git synced 2025-07-25 18:51:40 +02:00

View extender: Do not resolve factory

Not all requests need this factory, so there is no need to
instantiate one and load the required files.

Refs #1891, #2134.
This commit is contained in:
Franz Liedke
2020-07-17 12:01:56 +02:00
parent b5e891df30
commit 7e3d71a0a0

View File

@@ -42,10 +42,10 @@ class ViewNamespace implements ExtenderInterface
public function extend(Container $container, Extension $extension = null) public function extend(Container $container, Extension $extension = null)
{ {
$factory = $container->make(Factory::class); $container->resolving(Factory::class, function (Factory $view) {
foreach ($this->adds as $namespace => $hints) {
foreach ($this->adds as $namespace => $hints) { $view->addNamespace($namespace, $hints);
$factory->addNamespace($namespace, $hints); }
} });
} }
} }