1
0
mirror of https://github.com/flarum/core.git synced 2025-07-17 23:01:17 +02:00

Fixes issue with Laravel 8.48 filesystem changes

The FilesystemManager has changed to also allow to override
the config while resolving a filesystem.

This PR adds the argument and applies it if provided.
This commit is contained in:
Daniel Klabbers
2021-06-22 21:20:00 +02:00
committed by Daniël Klabbers
parent 5575b62f04
commit b30e642ad6

View File

@@ -35,16 +35,16 @@ class FilesystemManager extends LaravelFilesystemManager
/** /**
* @inheritDoc * @inheritDoc
*/ */
protected function resolve($name): Filesystem protected function resolve($name, $config = null): Filesystem
{ {
$driver = $this->getDriver($name); $localConfig = $config ?? $this->getLocalConfig($name);
$localConfig = $this->getLocalConfig($name);
if (empty($localConfig)) { if (empty($localConfig)) {
throw new InvalidArgumentException("Disk [{$name}] has not been declared. Use the Filesystem extender to do this."); throw new InvalidArgumentException("Disk [{$name}] has not been declared. Use the Filesystem extender to do this.");
} }
$driver = $config['driver'] ?? $this->getDriver($name);
if ($driver === 'local') { if ($driver === 'local') {
return $this->createLocalDriver($localConfig); return $this->createLocalDriver($localConfig);
} }