Skip to content
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

Feature Request: Mount points #127

Closed
kingcrunch opened this issue Apr 18, 2014 · 1 comment
Closed

Feature Request: Mount points #127

kingcrunch opened this issue Apr 18, 2014 · 1 comment

Comments

@kingcrunch
Copy link

I know, that there is a MountManager, but introducing different "protocols" (the part before the : in an URI) isn't, what "mounting" actually means. I'd expect something like

$local = new League\Flysystem\Filesystem($localAdapter);
$local->mount('/path/to/images', $s3ImagesAdapter);

So writiting to /path/to/images/foo.png actually pushes the changes to S3, while /path/to/backup/dump.sql uses the local file system. Note, that this is an example and can differ from the actual implementation, but the point is, that I could define "protocols" regarding their use case. For example I can define a "backup"-filesystem, but redirect some of the files to backup to a different storage. And even better I can change adapter at will, when requirements changes, without the need to change the code, that makes use of it. This is especially useful with #126

A different example utilizing the MountManager

$local = new League\Flysystem\Filesystem($localAdapter);

// Add them in the constructor
$manager = new League\Flysystem\MountManager(array(
    'backup' => $local,
));

$manager->mount('backup', '/dbdumps', $databaseS3);
$manager->mount('backup', '/images', $ImagesS3);

So why not using different protocols for db-dumps and images? Thats definitely a solution, but lets imagine I know want to split up images into user-images and cms-images. It is much easier to reconfigure the FS, so that /images/users and /images/cms write to different locations, than to rewrite the application to use images_user:/ and images_cms:/.

@frankdejonge
Copy link
Member

Currently there are no plans to implement this. Discussion can continue when there's a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants