Skip to content

Add Flysystem Adapter isDirectory support #637

Open
@floplus

Description

@floplus

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?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions