Update filesystem adapter to Flysystem v2#251
Closed
gijsdev wants to merge 1 commit into
Closed
Conversation
|
@gijsdev I just discovered it was not yet possible to use this with Flysystem 2.. Whats the current state of the PR? Do you need help? |
xvilo
suggested changes
Feb 16, 2022
xvilo
left a comment
There was a problem hiding this comment.
Apparently your PR was not fully according codestyle. I've created suggestions for you to easily apply it. Hopefully we could finish this somewhere this week or next week?
| /** | ||
| * @param FilesystemInterface $filesystem | ||
| * @param FilesystemOperator $filesystem | ||
| * @param string $folder |
There was a problem hiding this comment.
Suggested change
| * @param string $folder | |
| * @param string $folder |
| $this->filesystem->createDir($this->folder); | ||
| try { | ||
| $this->filesystem->deleteDirectory($this->folder); | ||
| } catch(UnableToDeleteDirectory $e) { |
There was a problem hiding this comment.
Suggested change
| } catch(UnableToDeleteDirectory $e) { | |
| } catch (UnableToDeleteDirectory $e) { |
|
|
||
| try { | ||
| $this->filesystem->createDirectory($this->folder); | ||
| } catch(UnableToCreateDirectory $e) { |
There was a problem hiding this comment.
Suggested change
| } catch(UnableToCreateDirectory $e) { | |
| } catch (UnableToCreateDirectory $e) { |
| @@ -119,16 +131,11 @@ protected function storeItemInCache(PhpCacheItem $item, $ttl) | |||
| ); | |||
|
|
|||
| $file = $this->getFilePath($item->getKey()); | |||
There was a problem hiding this comment.
Suggested change
| $file = $this->getFilePath($item->getKey()); | |
| $file = $this->getFilePath($item->getKey()); | |
| // To handle issues when/if race conditions occurs, we try to update here. | ||
| return $this->filesystem->update($file, $data); | ||
| $this->filesystem->write($file, $data); | ||
| return true; |
There was a problem hiding this comment.
Suggested change
| return true; | |
| return true; |
|
|
||
| return $this->filesystem->update($this->getFilePath($name), serialize($list)); | ||
| try { | ||
| $this->filesystem->write($this->getFilePath($name), serialize($list)); |
There was a problem hiding this comment.
Suggested change
| $this->filesystem->write($this->getFilePath($name), serialize($list)); | |
| $this->filesystem->write($this->getFilePath($name), serialize($list)); | |
| } catch (UnableToWriteFile $e) { | ||
| return false; | ||
| } | ||
|
|
|
|
||
| return $this->filesystem->update($this->getFilePath($name), serialize($list)); | ||
| try { | ||
| $this->filesystem->write($this->getFilePath($name), serialize($list)); |
There was a problem hiding this comment.
Suggested change
| $this->filesystem->write($this->getFilePath($name), serialize($list)); | |
| $this->filesystem->write($this->getFilePath($name), serialize($list)); | |
| try { | ||
| return $this->filesystem->delete($this->getFilePath($key)); | ||
| } catch (FileNotFoundException $e) { | ||
| $this->filesystem->delete($this->getFilePath($key)); |
There was a problem hiding this comment.
Suggested change
| $this->filesystem->delete($this->getFilePath($key)); | |
| $this->filesystem->delete($this->getFilePath($key)); | |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the Filesystem adapter to Flysystem v2
TODO