1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6declare(strict_types=1);
7
8namespace App\Libraries;
9
10class StorageUrl
11{
12 public static function make(?string $diskName, string $path): string
13 {
14 $diskName ??= $GLOBALS['cfg']['filesystems']['default'];
15 $baseUrl = $GLOBALS['cfg']['filesystems']['disks'][$diskName]['base_url'];
16
17 return "{$baseUrl}/{$path}";
18 }
19}