mirror of
https://github.com/archtechx/tenancy.git
synced 2026-09-20 13:34:04 +00:00
Improve symlink comments
Make it clear that both diskRoot and publicPath get the same prefix appended. In the possibleTenantSymlinks() docblock, correct the array example (the values are not just 'disk root' anymore -- if the disk has a prefix, it will be appended to the configured root).
This commit is contained in:
parent
1e1e2efb8c
commit
9e890e9a67
1 changed files with 4 additions and 2 deletions
|
|
@ -16,7 +16,7 @@ use Stancl\Tenancy\Contracts\Tenant;
|
|||
trait DealsWithTenantSymlinks
|
||||
{
|
||||
/**
|
||||
* Get all possible tenant symlinks, existing or not (array of ['public path' => 'disk root']).
|
||||
* Get all possible tenant symlinks, existing or not (array of ['public path' => 'disk root with the disk's prefix appended']).
|
||||
*
|
||||
* Tenants can have a symlink for each local disk that is listed
|
||||
* in both tenancy.filesystem.disks and tenancy.filesystem.url_override.
|
||||
|
|
@ -61,9 +61,11 @@ trait DealsWithTenantSymlinks
|
|||
$diskRoot = $tenantDisks[$disk]['root'];
|
||||
|
||||
if ($prefix = trim($disks[$disk]['prefix'] ?? '', '/\\')) {
|
||||
// Append the disk's prefix to the disk root
|
||||
$diskRoot = rtrim($diskRoot, '/\\') . DIRECTORY_SEPARATOR . $prefix;
|
||||
|
||||
// Storage::url() appends the disk's prefix to the url, so the prefix has to be in the public path as well
|
||||
// Append the same prefix to the public path.
|
||||
// Storage::url() appends the disk's prefix to the url, so the prefix has to be in the public path as well.
|
||||
$publicPath .= DIRECTORY_SEPARATOR . $prefix;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue