- Joined
- Apr 18, 2020
- Messages
- 310
- Points
- 73
Reputation:
I think I have done some steps...in this nightmare configuration...
Let see :
I created a storage zone in BUNNYCDN, connected to my pullzone = cdn.mydomain.com
Now...following the xenforo documentation for S3, I found that there are adapters for Bunnycdn too... ( yeah ! great ! but wait.... )
Here the doc links :
GitHub - BunnyWay/BunnyCDN.PHP.Storage: The official PHP library used for interacting with the BunnyCDN Storage API.
GitHub - PlatformCommunity/flysystem-bunnycdn: A flysystem adapter for BunnyCDN's storage
Using DigitalOcean Spaces or Amazon S3 for file storage in XF 2.x | XenForo community
The problem is that this code ( in config.php ) doesn't work...
Probably there are errors...or wrong path, or wrong reference, but no idea where...
HELP
Let see :
I created a storage zone in BUNNYCDN, connected to my pullzone = cdn.mydomain.com
Now...following the xenforo documentation for S3, I found that there are adapters for Bunnycdn too... ( yeah ! great ! but wait.... )
Here the doc links :
GitHub - BunnyWay/BunnyCDN.PHP.Storage: The official PHP library used for interacting with the BunnyCDN Storage API.
GitHub - PlatformCommunity/flysystem-bunnycdn: A flysystem adapter for BunnyCDN's storage
Using DigitalOcean Spaces or Amazon S3 for file storage in XF 2.x | XenForo community
The problem is that this code ( in config.php ) doesn't work...
PHP:
use BunnyCDN\Storage\BunnyCDNStorage;
use League\Flysystem\Filesystem;
use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNAdapter;
$client = new BunnyCDNAdapter(new BunnyCDNStorage('myzone', 'apikey', 'de'));
$filesystem = new Filesystem($client);
$config['fsAdapters']['data'] = function() use($filesystem)
{
return new \League\Flysystem\Filesystem($filesystem(), 'data');
};
$config['externalDataUrl'] = function($externalPath, $canonical)
{
return 'https://cdn.mydomain.com/forum/data/' . $externalPath;
};
$config['fsAdapters']['internal-data'] = function() use($filesystem)
{
return new \League\Flysystem\Filesystem($filesystem(), 'internal_data');
};
Probably there are errors...or wrong path, or wrong reference, but no idea where...
HELP