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

Add Flysystem Adapter isDirectory support #637

Open
floplus opened this issue May 12, 2020 · 0 comments
Open

Add Flysystem Adapter isDirectory support #637

floplus opened this issue May 12, 2020 · 0 comments
Assignees

Comments

@floplus
Copy link

floplus commented May 12, 2020

I was struggling to use a mixture of gaufrette with liip imagine and \Superbalist\Flysystem\GoogleStorage\GoogleStorageAdapter.

The missing key to use \Gaufrette\Adapter\Flysystem was that Gaufrette\Stream\InMemoryBuffer uses $this->filesystem->isDirectory($this->key) in stat(), which fails in \Gaufrette\Adapter\Flysystem due to UnsupportedAdapterMethodException('isDirectory is not supported by this adapter.') in isDirectory().

The way i solved this is by extending the \Gaufrette\Adapter\Flysystem and overwriting

    public function isDirectory($key)
    {
        return $this->adapter->has($key.'/');
    }

This is the same method as in \Gaufrette\Adapter\GoogleCloudStorage

Hope this helps somebody. Does it make sense to create a pull request?

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

3 participants