Jaxel
Well-known member
I've never used composer before... In my shell I ran the following commands:
This downloaded everything to the /vendor folder in my addon. I then added the following line to my addon.json:
However, running the following code:
Returns an error:
What am I missing?
Code:
cd src/addons/EWR/Backup
composer require aws/aws-sdk-php
Code:
"composer_autoload": "vendor\composer"
However, running the following code:
Code:
<?php
namespace EWR\Backup\Repository;
use XF\Mvc\Entity\AbstractCollection;
use XF\Mvc\Entity\Repository;
use Aws\S3;
class Amazon extends Repository
{
public $s3log;
public function runBackupS3($subpath, $subdir)
{
...
$client = new S3\S3Client([
'version' => 'latest',
'region' => $meta['region'],
'credentials' => [
'key' => $meta['key'],
'secret' => $options->EWRbackup_s3_secret,
]
]);
...
}
}
Returns an error:
Error: Class 'Aws\S3\S3Client' not found in src/addons/EWR/Backup/Repository/Amazon.php at line 24
What am I missing?