1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 13:40:20 +02:00

Clean up usages / deprecate path helpers (#2155)

* Write source map without creating temp file

Less I/O, and one less place where we access the global path helpers.

* Drop useless app_path() helper

This was probably taken straight from Laravel. There is no equivalent
concept in Flarum, so this should be safe to remove.

* Deprecate global path helpers

Developers using these helpers can inject the `Paths` class instead.

* Stop storing paths as strings in container

* Avoid using path helpers from Application class

* Deprecate path helpers from Application class

* Avoid using public_path() in prerequisite check

a) The comparison was already outdated, as a different path was passed.
b) We're trying to get rid of these global helpers.
This commit is contained in:
Franz Liedke
2020-06-19 22:16:03 +02:00
committed by GitHub
parent b82504b4b1
commit 88366fe8af
13 changed files with 143 additions and 77 deletions

View File

@@ -13,6 +13,7 @@ use Flarum\Console\Event\Configuring;
use Flarum\Foundation\AbstractServiceProvider;
use Flarum\Foundation\ErrorHandling\Registry;
use Flarum\Foundation\ErrorHandling\Reporter;
use Flarum\Foundation\Paths;
use Illuminate\Contracts\Debug\ExceptionHandler as ExceptionHandling;
use Illuminate\Contracts\Queue\Factory;
use Illuminate\Contracts\Queue\Queue;
@@ -70,7 +71,7 @@ class QueueServiceProvider extends AbstractServiceProvider
// Override the Laravel native Listener, so that we can ignore the environment
// option and force the binary to flarum.
$this->app->singleton(QueueListener::class, function ($app) {
return new Listener($app->basePath());
return new Listener($app[Paths::class]->base);
});
// Bind a simple cache manager that returns the cache store.