frostealth / yii2-aws-s3

An Amazon S3 component for Yii2
MIT License
91 stars 56 forks source link

Unknown Property – yii\base\UnknownPropertyException Setting unknown property: frostealth\yii2\aws\s3\Service::options #29

Closed mdsaif786 closed 6 years ago

mdsaif786 commented 7 years ago

's3' => [ 'class' => 'frostealth\yii2\aws\s3\Service', 'region' => 'ap-south-1', 'credentials' => [ // Aws\Credentials\CredentialsInterface|array|callable 'key' => 'xxxxxxxxxxxxxx', 'secret' => 'xxxxxxxxxxxxxxxx', ], 'options' => [ 'http' => [ 'verify' => false, ], ], 'defaultBucket' => 'b2b-img-search', 'defaultAcl' => 'public-read', 'debug' => false, // bool|array ], i am getting error

13

my question is where should i use 'options' => [ 'http' => [ 'verify' => false, ], ], value property?? 2) if comment options value e.g; 's3' => [ 'class' => 'frostealth\yii2\aws\s3\Service', 'region' => 'ap-south-1', 'credentials' => [ // Aws\Credentials\CredentialsInterface|array|callable 'key' => 'AKIAI6FFJVI5B64ZQE3Q', 'secret' => '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', ], // 'options' => [ // 'http' => [ // 'verify' => false, // ], // ], 'defaultBucket' => 'b2b-img-search', 'defaultAcl' => 'public-read', 'debug' => false, // bool|array ],

then i am getting this error..

123

frostealth commented 7 years ago

@mdsaif786 Which version is it?

mdsaif786 commented 7 years ago

I am using 7.1 version.

Get Outlook for Androidhttps://aka.ms/ghei36


From: Ivan Kudinov notifications@github.com Sent: Wednesday, May 24, 2017 8:23:56 PM To: frostealth/yii2-aws-s3 Cc: Md Saif; Mention Subject: Re: [frostealth/yii2-aws-s3] Unknown Property – yii\base\UnknownPropertyException Setting unknown property: frostealth\yii2\aws\s3\Service::options (#29)

@mdsaif786https://github.com/mdsaif786 Which version is it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/frostealth/yii2-aws-s3/issues/29#issuecomment-303749141, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFNzEraW-9i4R5xDjgfL7HhOxRSb3vqiks5r9ESEgaJpZM4Nk4Io.

frostealth commented 7 years ago

@mdsaif786 not php, version of the package. 1.0 or 2.0?

frostealth commented 7 years ago

Unfortunately, version 2.0 doesn't support S3Client customisation at the moment.

You can extend the Service:

<?php

namespace app\components\s3;

use frostealth\yii2\aws\s3\Service as BaseService

class Service extends BaseService
{
    public function setHttpOptions(array $options)
    {
        $this->clientConfig['http'] = $options;
    }
}
// config/main.php

'components' => [
    's3' => [
        'class' => '\app\components\s3\Service',
        // ...
        'httpOptions' => ['verify' => false],
    ],
]
mdsaif786 commented 7 years ago

Yes...this is working fine.But I have found some alternative solution also https://stackoverflow.com/questions/29822686/curl-error-60-ssl-certificate-unable-to-get-local-issuer-certificate/34883260#34883260 Thank you frostealth.