flysystem-google-cloud-storage icon indicating copy to clipboard operation
flysystem-google-cloud-storage copied to clipboard

fixes #106 has function does not return true for directories

Open MordiSacks opened this issue 5 years ago • 1 comments

MordiSacks avatar Dec 23 '19 09:12 MordiSacks

Could also use this, since gcs interpret path name ending with slash ('/') as a directory.

public function has($path)
    {
        if ($this->getObject($path.'/')->exists()){
            return true;
	}
	return $this->getObject($path)->exists();
    }

Basically, this code check if the given path is a directory, if not, check if it is a file.

drionix avatar Jan 26 '20 09:01 drionix