twistor / flysystem-stream-wrapper

Provides the ability to register Flysystem filesystems as stream wrappers.
MIT License
58 stars 19 forks source link

is_writable always return false #5

Closed SamMousa closed 6 years ago

SamMousa commented 7 years ago

For me is_writable always returns false because the uid and gid are always set to 0.

Currently Stat::mergeMeta() ignores any uid or gid returned from the adapter; would it not make more sense to use them if they are available?

twistor commented 7 years ago

I will look into this. Adapters do not return the uid or gid.

twistor commented 7 years ago

One option is to pass in a different permission array when registering the stream wrapper.

$options = [
        'permissions' => [
            'dir' => [
                'private' => 0700,
                'public' => 0777,
            ],
            'file' => [
                'private' => 0600,
                'public' => 0666,
            ],
        ],
    ];

FlysystemStreamWrapper::register('fly', $filesystem, $options)

twistor commented 6 years ago

I've added calls to either posix_getuid() or getmyuid() to set the uid and gid of returned files.