Код: Выделить всё
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
use GuzzleHttp\Psr7\Utils;
aws_sdk_connect($region,$creds);
function aws_sdk_connect($region,$creds)
{
$s3Client = new S3Client(['region' => $region, 'version' => 'latest', 'credentials' => $creds]);
$buckets = $s3Client->listBuckets();
foreach ($buckets['Buckets'] as $bucket) {
echo $bucket['Name'];
}
}
Код: Выделить всё
require 'vendor/autoload.php';
use _PhpScoper87b4a9639731\Aws\S3\S3Client;
use _PhpScoper87b4a9639731\Aws\S3\Exception\S3Exception;
use _PhpScoper87b4a9639731\GuzzleHttp\Psr7\Utils;
aws_sdk_connect($region,$creds);
function aws_sdk_connect($region,$creds)
{
$s3Client = new S3Client(['region' => $region, 'version' => 'latest', 'credentials' => $creds]);
$buckets = $s3Client->listBuckets();
foreach ($buckets['Buckets'] as $bucket) {
echo $bucket['Name'];
}
}
Код: Выделить всё
"Fatal error: Uncaught RuntimeException: Unable to determine what Guzzle version is installed. in /build/vendor/aws/aws-sdk-php/src/functions.php:305"Код: Выделить всё
function guzzle_major_version()
{
static $cache = null;
if (null !== $cache) {
return $cache;
}
if (\defined('\\GuzzleHttp\\ClientInterface::VERSION')) {
$version = (string) ClientInterface::VERSION;
if ($version[0] === '6') {
return $cache = 6;
}
if ($version[0] === '5') {
return $cache = 5;
}
} elseif (\defined('\\GuzzleHttp\\ClientInterface::MAJOR_VERSION')) {
return $cache = ClientInterface::MAJOR_VERSION;
}
throw new \RuntimeException('Unable to determine what Guzzle version is installed.');
}
Подробнее здесь: https://stackoverflow.com/questions/784 ... php-scoper
Мобильная версия