33if (! defined ('TINY_DEBUG ' )) {
44 define ('TINY_DEBUG ' , null );
55}
6- define ('AWS_REGION ' , getenv ('AWS_REGION ' ));
7- define ('AWS_ENDPOINT ' , getenv ('AWS_ENDPOINT ' ));
8- define ('AWS_ACCESS_KEY_ID ' , getenv ('AWS_ACCESS_KEY_ID ' ));
9- define ('AWS_SECRET_ACCESS_KEY ' , getenv ('AWS_SECRET_ACCESS_KEY ' ));
106
117class Tiny_Config
128{
@@ -17,23 +13,6 @@ class Tiny_Config
1713 const META_KEY = 'tiny_compress_images ' ;
1814}
1915
20- /**
21- * Filter for adding arguments to the AS3CF AWS client.
22- * Required to point the client to the LocalStack instance.
23- */
24- add_filter ('as3cf_aws_init_client_args ' , function ($ args ) {
25- $ args ['endpoint ' ] = AWS_ENDPOINT ;
26- $ args ['use_path_style_endpoint ' ] = true ;
27- $ args ['region ' ] = AWS_REGION ;
28- return $ args ;
29- });
30-
31- // Force all S3 URLs to use LocalStack instead of s3.amazonaws.com
32- add_filter ('as3cf_aws_s3_url_domain ' , function ($ domain , $ bucket , $ region , $ expires , $ args ) {
33- // Replace any AWS domain with LocalStack
34- return AWS_ENDPOINT . '/ ' . $ bucket ;
35- }, 10 , 5 );
36-
3716// ajax hook to delete all attachments as doing it via UI is flaky
3817add_action ( 'wp_ajax_clear_media_library ' , 'clear_media_library ' );
3918function clear_media_library () {
0 commit comments