vip-go-mu-plugins icon indicating copy to clipboard operation
vip-go-mu-plugins copied to clipboard

Stream Wrapper: opendir triggers a warning

Open mjangda opened this issue 7 years ago • 5 comments

wp> opendir( 'vip://wp-content/uploads/test/' );
Warning: opendir(vip://wp-content/uploads/test/): failed to open dir: "Automattic\VIP\Files\VIP_Filesystem_Stream_Wrapper::dir_opendir" call failed

mjangda avatar Feb 12 '19 20:02 mjangda

We should probably add dir_opendir which just calls return false since we don't really support directory operations (like iterating).

mjangda avatar Feb 20 '19 04:02 mjangda

The same is true for scandir().

wp> scandir('vip://wp-content/uploads/sites/3');
Warning: scandir(vip://wp-content/uploads/sites/3): failed to open dir: "Automattic\VIP\Files\VIP_Filesystem_Stream_Wrapper::dir_opendir" call failed
bool(false)

This issue appears to be blocking plugins which clone sites within a multisite network from recursively copying media files. What alternatives do we have for situations requiring iteration over directories?

andrewfleming avatar Dec 30 '20 05:12 andrewfleming

This issue also appears to affect plugins that store styles within a new directory inside wp-content/uploads. So, a CSS file can't be written to wp-content/uploads/dynamic-css/filename.css and a URL like https://example.go-vip.net/wp-content/uploads/dynamic-styles-css/filename.css returns an HTTP 404

shantanu2704 avatar Feb 17 '21 06:02 shantanu2704

What's the issue with triggering a warning if it's not supported?

rebeccahum avatar Aug 12 '22 18:08 rebeccahum

This issue has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed.

This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched.

github-actions[bot] avatar Oct 12 '22 00:10 github-actions[bot]