Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Gets the value of a single or all environment variables
<?php getenv(?string $name = null, bool $local_only = false): string|array|false
<?php return static::$s3Client;
}
$key = getenv('FLYSYSTEM_AWS_S3_KEY');
$secret = getenv('FLYSYSTEM_AWS_S3_SECRET');
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$region = getenv('FLYSYSTEM_AWS_S3_REGION') ?: 'eu-central-1';
<?php }
$key = getenv('FLYSYSTEM_AWS_S3_KEY');
$secret = getenv('FLYSYSTEM_AWS_S3_SECRET');
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$region = getenv('FLYSYSTEM_AWS_S3_REGION') ?: 'eu-central-1';
<?php $key = getenv('FLYSYSTEM_AWS_S3_KEY');
$secret = getenv('FLYSYSTEM_AWS_S3_SECRET');
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$region = getenv('FLYSYSTEM_AWS_S3_REGION') ?: 'eu-central-1';
if ( ! $key || ! $secret || ! $bucket) {
<?php $key = getenv('FLYSYSTEM_AWS_S3_KEY');
$secret = getenv('FLYSYSTEM_AWS_S3_SECRET');
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$region = getenv('FLYSYSTEM_AWS_S3_REGION') ?: 'eu-central-1';
if ( ! $key || ! $secret || ! $bucket) {
self::markTestSkipped('No AWS credentials present for testing.');
<?php {
static::$stubS3Client = new S3ClientStub(static::s3Client());
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$prefix = getenv('FLYSYSTEM_AWS_S3_PREFIX') ?: static::$adapterPrefix;
return new AsyncAwsS3Adapter(static::$stubS3Client, $bucket, $prefix, null, null);
<?php static::$stubS3Client = new S3ClientStub(static::s3Client());
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$prefix = getenv('FLYSYSTEM_AWS_S3_PREFIX') ?: static::$adapterPrefix;
return new AsyncAwsS3Adapter(static::$stubS3Client, $bucket, $prefix, null, null);
}
<?php public static function setUpBeforeClass(): void
{
static::$adapterPrefix = getenv('FLYSYSTEM_AWS_S3_PREFIX') ?: 'ci/' . bin2hex(random_bytes(10));
}
protected function tearDown(): void
<?php return static::$s3Client;
}
$key = getenv('FLYSYSTEM_AWS_S3_KEY');
$secret = getenv('FLYSYSTEM_AWS_S3_SECRET');
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$region = getenv('FLYSYSTEM_AWS_S3_REGION') ?: 'eu-central-1';
<?php }
$key = getenv('FLYSYSTEM_AWS_S3_KEY');
$secret = getenv('FLYSYSTEM_AWS_S3_SECRET');
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$region = getenv('FLYSYSTEM_AWS_S3_REGION') ?: 'eu-central-1';
<?php $key = getenv('FLYSYSTEM_AWS_S3_KEY');
$secret = getenv('FLYSYSTEM_AWS_S3_SECRET');
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$region = getenv('FLYSYSTEM_AWS_S3_REGION') ?: 'eu-central-1';
if ( ! $key || ! $secret || ! $bucket) {
<?php $key = getenv('FLYSYSTEM_AWS_S3_KEY');
$secret = getenv('FLYSYSTEM_AWS_S3_SECRET');
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$region = getenv('FLYSYSTEM_AWS_S3_REGION') ?: 'eu-central-1';
if ( ! $key || ! $secret || ! $bucket) {
self::markTestSkipped('No AWS credentials present for testing.');
<?php public function streaming_reads_are_not_seekable_and_non_streaming_are(bool $streaming, bool $seekable): void
{
if (getenv('COMPOSER_OPTS') === '--prefer-lowest') {
$this->markTestSkipped('The SDK does not support streaming in low versions.');
}
<?php $prefixedPath = $prefixer->prefixPath('path.txt');
$adapter->write('path.txt', 'contents', new Config(['ACL' => 'bucket-owner-full-control']));
$arguments = ['Bucket' => getenv('FLYSYSTEM_AWS_S3_BUCKET'), 'Key' => $prefixedPath];
$command = static::$s3Client->getCommand('GetObjectAcl', $arguments);
$response = static::$s3Client->execute($command)->toArray();
$permission = $response['Grants'][0]['Permission'];
<?php {
static::$stubS3Client = new S3ClientStub(static::s3Client());
$bucket = getenv('FLYSYSTEM_AWS_S3_BUCKET');
$prefix = static::$adapterPrefix;
return new AwsS3V3Adapter(static::$stubS3Client, $bucket, $prefix, null, null, $options, $streaming);