mirror of
https://github.com/flarum/core.git
synced 2025-08-13 11:54:32 +02:00
Compare commits
2 Commits
dw/remove-
...
as/safe-mo
Author | SHA1 | Date | |
---|---|---|---|
|
766e3390d7 | ||
|
5ebc101fd5 |
@@ -168,7 +168,9 @@ export default class Application {
|
||||
}
|
||||
|
||||
boot() {
|
||||
this.initializers.toArray().forEach((initializer) => initializer(this));
|
||||
if (this.data.attributes.bootExtensions) {
|
||||
this.initializers.toArray().forEach((initializer) => initializer(this));
|
||||
}
|
||||
|
||||
this.store.pushPayload({ data: this.data.resources });
|
||||
|
||||
|
@@ -77,6 +77,7 @@ class ForumSerializer extends AbstractSerializer
|
||||
'baseUrl' => $url = $this->url->to('forum')->base(),
|
||||
'basePath' => parse_url($url, PHP_URL_PATH) ?: '',
|
||||
'debug' => $this->config->inDebugMode(),
|
||||
'bootExtensions' => $this->config->bootExtensions(),
|
||||
'apiUrl' => $this->url->to('api')->base(),
|
||||
'welcomeTitle' => $this->settings->get('welcome_title'),
|
||||
'welcomeMessage' => $this->settings->get('welcome_message'),
|
||||
|
@@ -11,6 +11,7 @@ namespace Flarum\Extension;
|
||||
|
||||
use Flarum\Extension\Event\Disabling;
|
||||
use Flarum\Foundation\AbstractServiceProvider;
|
||||
use Flarum\Foundation\Config;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
class ExtensionServiceProvider extends AbstractServiceProvider
|
||||
@@ -28,7 +29,12 @@ class ExtensionServiceProvider extends AbstractServiceProvider
|
||||
// below, so that extensions have a chance to register things on the
|
||||
// container before the core boots up (and starts resolving services).
|
||||
$this->container['flarum']->booting(function () {
|
||||
$this->container->make('flarum.extensions')->extend($this->container);
|
||||
/** @var Config */
|
||||
$config = $this->container->make(Config::class);
|
||||
|
||||
if ($config->bootExtensions()) {
|
||||
$this->container->make('flarum.extensions')->extend($this->container);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -42,6 +42,11 @@ class Config implements ArrayAccess
|
||||
return $this->data['offline'] ?? false;
|
||||
}
|
||||
|
||||
public function bootExtensions(): bool
|
||||
{
|
||||
return $this->data['boot_extensions'] ?? true;
|
||||
}
|
||||
|
||||
private function requireKeys(...$keys)
|
||||
{
|
||||
foreach ($keys as $key) {
|
||||
|
Reference in New Issue
Block a user