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