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 Alexander Skvortsov
parent 3224aeabac
commit 99eeaf0be5

View File

@ -7,6 +7,7 @@
* LICENSE file that was distributed with this source code.
*/
use Flarum\Foundation\Paths;
use Flarum\Install\AdminUser;
use Flarum\Install\BaseUrl;
use Flarum\Install\DatabaseConfig;
@ -38,10 +39,12 @@ echo "\nOff we go...\n";
*/
$installation = new Installation(
__DIR__.'/tmp',
__DIR__.'/tmp/public',
__DIR__.'/tmp/storage',
__DIR__.'/../../vendor'
new Paths([
'base' => __DIR__.'/tmp',
'public' => __DIR__.'/tmp/public',
'storage' => __DIR__.'/tmp/storage',
'vendor' => __DIR__.'/../../vendor',
])
);
$pipeline = $installation