aws / aws-sdk-php-zf2

ZF2 module for using the AWS SDK for PHP to interact with AWS services like S3, DynamoDB, SQS, EC2, etc.
http://aws.amazon.com/sdkforphp/
Apache License 2.0
103 stars 63 forks source link

$sm->get(DynamoDbSaveHandler::class); i got a error #42

Closed dovanmanh080485 closed 8 years ago

dovanmanh080485 commented 8 years ago

i'm working with zend2. when i try to call on Module.php (getServiceConfig function)

$saveHandler = $sm->get(DynamoDbSaveHandler::class); i got a error

Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for AwsModule\Session\SaveHandler\DynamoDb ...............

can you help me ?

cjyclaire commented 8 years ago

@dovanmanh080485, May I ask which package version are you using? Could you try v2.0.x?

dovanmanh080485 commented 8 years ago

Hello @cjyclaire thanks for your reply

Yes i am using v2.0.x and zend 2.5. I am flowing this this link https://framework.zend.com/manual/2.1/en/modules/zend.session.manager.html for setting session handler. if (isset($session['save_handler'])) { // class should be fetched from service manager since it will require constructor arguments $sessionSaveHandler = $sm->get($session['save_handler']); }else{ // here my code $sessionSaveHandler = $sm->get(DynamoDbSaveHandler::class);

}

Am I right way ?

dovanmanh080485 commented 8 years ago

@cjyclaire Hello,

it's my mistake. it's fixed. thanks.

jarrettj commented 8 years ago

Hey good day.

How did you fix it @cjyclaire ?

dovanmanh080485 commented 8 years ago

@jarrettj it's wrong version.

jarrettj commented 8 years ago

Thanks @dovanmanh080485. Changed to latest version :)