-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x][Filesystem] Provide an additional argument for tenant name path #817
Conversation
In this PR we let the user pass an additional parameter using `%tenant%` so the user can additionally pass the folder corresponding to each tenant. This is my proposal, because if I try to use %storage_path% within Linux, I get the full path to the project when I use Google Cloud Storage
Moving from $subject to $root when %storage_path% has been replaced
Isn't the tenant folder created automatically ? So you simply need to do: 'root_override' => [
// ...
'gcs' => 'tenants/',
], Unless if I'm missing something |
Yeah I think @stein-j's suggestion should work? Not exactly sure what the problem is here. S3 doesn't use the |
Using GCS the path adds a "/" folder as root |
What do you mean by that? |
I still don't understand. If you want this feature added, please explain clearly what the issue is and how this would solve it. |
@stancl I just updated the description :D. I tried to be clearer. Also as mentioned in #802 (comment), I'll wait for that merge and update this PR after that. |
Note that I just pushed some changes to this logic |
@stancl @vstyler96 some any news? |
@vstyler96 Could you resolve the conflicts? |
@stancl Ready to go! 🤝 P.S: Also removed a no longer used class on |
@stancl is ready :) |
Thanks! |
i'm getting mkdir(): File exists error on [app / Jobs / CreateFrameworkDirectoriesForTenant.php : 21] |
Summary of changes
During the work of an application that uses Google Cloud Storage as the main storage method. I found that if we want to save a file without overriding the default root path for GCS, the
FilesystemTenancyBootstrapper
adds an additional folder in the GCS Filesystem called/
.So I decided to pass a custom folder path.
Case 1: using %storage_path%
If we try to use the param %storage_path% this will add the full path to our project into the GCS filesystem.
Case 2: using a custom path without %storage_path%
I tried to pass a custom path, but this does not include the tenant folder. so the files from all tenants are mixed with each other (not expected)
So my resolution includes a minor update to the
$finalPrefix
variable. If we add a %tenant% variable, this will let us pass a more customizable path. So we can pass the/a/random/path/for/my/tenant/%tenant%
path or any other path manually for each tenant in filesystems like GCS or S3