I wouldn't recommend it. XF expects them to be there, and there are scenarios where we'll complain if they don't exist. Internal data also contains some other stuff which isn't offloaded by default.
We also cannot guarantee that any add-ons (those which haven't followed XF standards) haven't written directly into those directories and therefore won't be offloaded.
You should, however, at minimum be able to remove data/avatars, data/attachments, data/video (in XF 2.1), data/resource_icons and data/xfmg. And internal_data/attachments, internal_data/file_check, internal_data/image_cache, internal_data/sitemaps.
<?php
$config['db']['host'] = '127.0.0.1';
$config['db']['port'] = '3306';
$config['db']['username'] = 'root';
$config['db']['password'] = 'root';
$config['db']['dbname'] = 'mt';
$config['superAdmins'] = '1';
$config['enableTfa'] = false;
$s3 = function()
{
return new \Aws\S3\S3Client([
'credentials' => [
'key' => '1234',
'secret' => '5678'
],
'region' => 'sfo2',
'version' => 'latest',
'endpoint' => 'https://sfo2.digitaloceanspaces.com'
]);
};
$config['fsAdapters']['data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), 'xftest', 'data');
};
$config['externalDataUrl'] = function($externalPath, $canonical)
{
return 'https://xftest.sfo2.digitaloceanspaces.com/data/' . $externalPath;
};
<?php
$config['db']['host'] = 'localhost';
$config['db']['port'] = '3306';
$config['db']['username'] = 'root';
$config['db']['password'] = 'root';
$config['db']['dbname'] = 'mt';
$config['fullUnicode'] = true;
$config['fsAdapters']['data'] = function()
{
$s3 = new \Aws\S3\S3Client([
'credentials' => [
'key' => '1234',
'secret' => '4567'
],
'region' => 'sfo2',
'version' => 'latest',
'endpoint' => 'https://sfo2.digitaloceanspaces.com'
]);
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3, 'xftest', 'data');
};
$config['externalDataUrl'] = function($externalPath, $canonical)
{
return 'https://xftest.sfo2.digitaloceanspaces.com/data/' . $externalPath;
};
\XFAws\Composer::autoloadNamespaces(\XF::app());
\XFAws\Composer::autoloadPsr4(\XF::app());
\XFAws\Composer::autoloadClassmap(\XF::app());
\XFAws\Composer::autoloadFiles(\XF::app());
thanks, I'm seeking what's wrong and testing.You don’t have to do anything other than the guide asks you to do (it definitely does not tell you to add those auto load lines).
All I can tell you is that the examples you have given appear to be correct so it should just work like it does for everyone else.
diff -r 0a4e1078630e xenforo/src/addons/XFAws/_vendor/league/flysystem-aws-s3-v3/src/AwsS3Adapter.php
--- a/xenforo/src/addons/XFAws/_vendor/league/flysystem-aws-s3-v3/src/AwsS3Adapter.php Sun Jan 06 06:03:48 2019 +0000
+++ b/xenforo/src/addons/XFAws/_vendor/league/flysystem-aws-s3-v3/src/AwsS3Adapter.php Tue Jan 08 04:46:52 2019 +0000
@@ -553,7 +553,7 @@
$options = $this->getOptionsFromConfig($config);
$acl = isset($options['ACL']) ? $options['ACL'] : 'private';
- if ( ! isset($options['ContentType']) && is_string($body)) {
+ if ( ! isset($options['ContentType']) && !is_string($body)) {
$options['ContentType'] = Util::guessMimeType($path, $body);
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.