XF 2.1 Trying to get the DigitalOcean Spaces addon working

Status
Not open for further replies.

rockstarmind

Active member
Hey guys,

Here's what I did:

1) I installed the addon by @Chris D
2) I copied the "data" and "internal data" folders to my DigitalOcean Space
3) I updated the config.php file with the code in the instructions
4) I got this error message when I replaced my config.php and tried updating my avatar (which was blank):

ErrorException: [E_WARNING] Use of undefined constant ‘rockstarmind’ - assumed '‘rockstarmind’' (this will throw an Error in a future version of PHP) in src/config.php at line 26
  1. XF::handlePhpError() in src/config.php at line 26
  2. XF\App->{closure}()
  3. call_user_func() in src/XF/FsMounts.php at line 17
  4. XF\FsMounts::loadDefaultMounts() in src/XF/App.php at line 1029
  5. XF\App->XF\{closure}() in src/XF/Container.php at line 28
  6. XF\Container->offsetGet() in src/XF/App.php at line 2409
  7. XF\App->fs() in src/XF/Util/File.php at line 185
  8. XF\Util\File::copyFileToAbstractedPath() in src/XF/Service/User/Avatar.php at line 269
  9. XF\Service\User\Avatar->updateAvatar() in src/XF/Pub/Controller/Account.php at line 466
  10. XF\Pub\Controller\Account->actionAvatar() in src/XF/Mvc/Dispatcher.php at line 321
  11. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 244
  12. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
  13. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
  14. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
  15. XF\App->run() in src/XF.php at line 390
  16. XF::runApp() in index.php at line 20
Not sure if I needed to move over more than just the data and internal data folders and not sure how to fix this. I've since restored the original config.php file

Here is the new one (with sensitive info as INSERT:

<?php

$config['db']['host'] = 'localhost';
$config['db']['port'] = '3306';
$config['db']['username'] = 'INSERT';
$config['db']['password'] = 'INSERT';
$config['db']['dbname'] = 'INSERT';

$config['fullUnicode'] = true;

$s3 = function()
{
return new \Aws\S3\S3Client([
'credentials' => [
'key' => 'INSERT',
'secret' => 'INSERT'
],
'region' => 'sfo2',
'version' => 'latest',
'endpoint' => 'https://sfo2.digitaloceanspaces.com'
]);
};

$config['fsAdapters']['data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), ‘INSERT’, 'data');
};

$config['externalDataUrl'] = function($externalPath, $canonical)
{
return 'https://INSERT.sfo2.digitaloceanspaces.com' . $externalPath;
};

$config['fsAdapters']['internal-data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), ‘INSERT’, 'internal_data');
};


Please help.
 
Last edited:
Status
Not open for further replies.
Top Bottom