T
for example with yii-debug, my template It has no root aliases, but @app is my root.
common flysystem for yii-debug:
FilesystemInterface::class => static function () use ($params) {
$aliases = $params['aliases'] ?? [];
if (!isset($aliases['@root'])) {
throw new \RuntimeException('Alias of the root directory is not defined.');
}
$adapter = new LocalFilesystemAdapter(
$aliases['@root'],
PortableVisibilityConverter::fromArray([
'file' => [
'public' => 0644,
'private' => 0600,
],
'dir' => [
'public' => 0755,
'private' => 0700,
],
]),
LOCK_EX,
LocalFilesystemAdapter::DISALLOW_LINKS
);
return new Filesystem($adapter, $aliases);
},
FileStorageConfigs::class => static function () use ($params) {
$configs = $params['file.storage'] ?? [];
return new FileStorageConfigs($configs);
}
It will not work so we have two options, or it is handled with parameters or standardize the names of the aliases of all the extensions that need it.