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

Allow mount identifier, for MountManager of FlySystem library, into prefixes #325

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ElGigi
Copy link

@ElGigi ElGigi commented Jun 10, 2021

Allow mount identifier, for MountManager of FlySystem library, into prefixes.

$server->setSourcePathPrefix('source://');
$server->setCachePathPrefix('cache://');

@@ -111,6 +111,17 @@ public function __construct(FilesystemOperator $source, FilesystemOperator $cach
$this->tempDir = sys_get_temp_dir();
}

private function trimPrefix(string $prefix): string
{
if ('//' == substr($prefix, -2)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not check for '://' === substr($prefix, -3) instead of having a separate check for :?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you respond to above query please.

@ElGigi
Copy link
Author

ElGigi commented Nov 30, 2021

A little push to allow mount identifier into path without set prefix.
Example: get file "img://my/img.jpg"

If i set a cache prefix ; the mount identifier is removed.

Example: set cache prefix "cache://my/dir" and get "img://my/img.jpg" , the cache path will be "cache://my/dir/my/img/jpg"

@ElGigi
Copy link
Author

ElGigi commented Jan 22, 2022

Any news? Thx

@ElGigi ElGigi requested a review from ADmad August 25, 2022 08:02
src/Server.php Outdated Show resolved Hide resolved
src/Server.php Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

2 participants