humanmade / humanmade/altis-cloud
Add a `WP_Filesystem_S3_Uploads` class to handle writing to uploads and warning when trying to write elsewhere
- Dominant language
- PHP
- Stars
- 9
- Forks
- 2
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 23
Description
In Altis Cloud environments the servers are not writable, only the uploads directory is writable via the `s3://` protocol.
Some 3rd party plugins (and possibly plugins we may wish to integrate in future like MultiLingualPress) rely on accessing and using the WP file system class for copying uploads and things. This could be made to work seamlessly for paths in uploads and warnings thrown for everything else by providing a file system class in Altis or in S3 Uploads itself.
For Altis we could then force the usage of this filesystem class using the following filter:
```php
/**
* Force the filesystem to use the `WP_Filesystem_S3_Uploads` class.
*
* @return string Filesystem method to return.
*/
add_filter( 'filesystem_method', function() : string {
return 'S3_Uploads';
}, 99 );
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.