Gaufrette icon indicating copy to clipboard operation
Gaufrette copied to clipboard

StreamWrapper full support missing

Open unusorin opened this issue 10 years ago • 7 comments

Hi guys, I've encountered a problem with Gauffrete StreamWrapper. It seems that dir_open (http://www.php.net/manual/en/streamwrapper.dir-opendir.php) method wasn't implemented. This causes calls like is_dir and scandir to crash.

Case:

$map = \Gaufrette\StreamWrapper::getFilesystemMap();
$map->set('vendor', new \Gaufrette\Filesystem(new \Gaufrette\Adapter\Local(__DIR__ . DIRECTORY_SEPARATOR . 'vendor/')));

\Gaufrette\StreamWrapper::register();

var_dump(scandir('gaufrette://vendor/'));

Output:

PHP Warning:  scandir(gaufrette://vendor/): failed to open dir: "Gaufrette\StreamWrapper::dir_opendir" call failed in test.sandbox.php on line 59

Environment:

OS: Ubuntu 12.04 x64
PHP Version: PHP 5.5.9-1+sury.org~precise+1 (cli) (built: Feb 13 2014 15:53:53) 
                      Copyright (c) 1997-2014 The PHP Group
                      Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
                      with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
                      with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
 Gaufrette: dev-master

Thanks, Sorin!

unusorin avatar Apr 09 '14 09:04 unusorin

@unusorin i have the same issue!

wachterjohannes avatar May 12 '14 09:05 wachterjohannes

Warning: stream_set_blocking(): Gaufrette\StreamWrapper::stream_set_option is not implemented!

zartdinov avatar May 29 '15 16:05 zartdinov

Same here !

apsylone avatar Sep 29 '15 21:09 apsylone

Gaufrette only support file actions. You can't create/scan/unlink a folder with the streamwrapper.

Baachi avatar Oct 06 '15 12:10 Baachi

Is this an official answer ?

unusorin avatar Oct 06 '15 15:10 unusorin

This is the current state, you can change it with a PR :smile:

Baachi avatar Oct 06 '15 17:10 Baachi

Gaufrette only support file actions. You can't create/scan/unlink a folder with the streamwrapper.

Not even all file actions are supported. rename(), for instance, is not.

rimas-kudelis avatar Jan 28 '21 12:01 rimas-kudelis