protected function ensureBucketExists()
    {
        if ($this->bucketExists) {
            return true;
        }

        if ($this->bucketExists = $this->service->doesBucketExist($this->bucket)) {
            return true;
        }

        if (!$this->options['create']) {
            throw new \RuntimeException(sprintf(
                'The configured bucket "%s" does not exist.',
                $this->bucket
            ));
        }

        $this->service->createBucket([
            'Bucket' => $this->bucket,
            'LocationConstraint' => $this->service->getRegion()
        ]);
        $this->bucketExists = true;

        return true;
    }
protected function ensureBucketExists()
    {
        if ($this->bucketExists) {
            return true;
        }

        if ($this->bucketExists = $this->service->doesBucketExist($this->bucket)) {
            return true;
        }

        if (!$this->options['create']) {
            throw new \RuntimeException(sprintf(
                'The configured bucket "%s" does not exist.',
                $this->bucket
            ));
        }

        $this->service->createBucket([
            'Bucket' => $this->bucket,
            'LocationConstraint' => $this->service->getRegion()
        ]);
        $this->bucketExists = true;

        return true;
    }
protected function ensureBucketExists ( ) { if ( $ this -> bucketExists ) { return true ; } if ( $ this -> bucketExists = $ this -> service -> doesBucketExist ( $ this -> bucket ) ) { return true ; } if ( ! $ this -> options [ 'create' ] ) { throw new \ RuntimeException ( sprintf ( 'The configured bucket "%s" does not exist.' , $ this -> bucket ) ) ; } $ this -> service -> createBucket ( [ 'Bucket' => $ this -> bucket , 'LocationConstraint' => $ this -> service -> getRegion ( ) ] ) ; $ this -> bucketExists = true ; return true ; }
Ensures the specified bucket exists. If the bucket does not exists
and the create option is set to true, it will try to create the
bucket. The bucket is created using the same region as the supplied
client object.

@throws \RuntimeException if the bucket does not exists or could not be
created
Ensures the specified bucket exists . If the bucket does not exists and the create option is set to true it will try to create the bucket . The bucket is created using the same region as the supplied client object .