1
0
mirror of https://github.com/flarum/core.git synced 2025-08-15 04:44:08 +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

@@ -11,6 +11,7 @@ namespace Flarum\Locale;
use Flarum\Foundation\AbstractServiceProvider;
use Flarum\Foundation\Event\ClearingCache;
use Flarum\Foundation\Paths;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Translation\Translator as TranslatorContract;
@@ -73,6 +74,6 @@ class LocaleServiceProvider extends AbstractServiceProvider
private function getCacheDir(): string
{
return $this->app['flarum']->storagePath().'/locale';
return $this->app[Paths::class]->storage.'/locale';
}
}