简体   繁体   English

AWS PHP SDK v3中的createSessionsTable是否等效?

[英]createSessionsTable equivalent in v3 of AWS PHP SDK?

I'm trying to use DynamoDB to handle my PHP's session. 我正在尝试使用DynamoDB处理我的PHP会话。 In version 2 of AWS SDK there was a function called createSessionsTable that would create the sessions table table_name you specified in registerSessionHandler(['table_name' => 'table_name' ]) as you can read here . 在AWS开发工具包的版本2中,有一个名为createSessionsTable的函数,该函数将创建您在registerSessionHandler(['table_name'=> 'table_name' ])中指定的会话表table_name ,您可以在此处阅读

I can't this function in AWS SDK 3.0 ? 我无法在AWS开发工具包3.0中使用此功能吗? Has this function been depricated? 该功能是否已被描述? If so how can I create the sessions table? 如果可以,如何创建会话表? What is the format for it? 它的格式是什么? Or does AWS initialize it implicitly in v3 and it gets created on the fly now? 还是AWS在v3中隐式初始化它并立即创建它? I can't seem to find anything on Google. 我似乎在Google上找不到任何东西。

Anyone using DynamoDB session hadler in AWS SDK V3.0 please help. 在AWS开发工具包V3.0中使用DynamoDB会话hadler的任何人都请帮助。

The createSessionsTable method has indeed been removed in v3 of the AWS SDK for PHP: 实际上,适用于PHP的AWS开发工具包的v3已删除了createSessionsTable方法:

Per the configuration guidance in the Session Handler documentation : 根据会话处理程序文档中的配置指南:

table_name TABLE_NAME
The name of the DynamoDB table in which to store the sessions. 在其中存储会话的DynamoDB表的名称。 This defaults to 'sessions'. 默认为“会话”。

hash_key 散列键
The name of the hash key in the DynamoDB sessions table. DynamoDB会话表中的哈希键名称。 This defaults to 'id'. 默认为“ id”。

You can simply create a table in DynamoDB with name 'sessions' and primary key with name 'id' of type 'String', and it will match the Session Handler defaults. 您可以简单地在DynamoDB中创建一个名称为'sessions'且主键的名称为'id'类型为'String'的表,它将与会话处理程序的默认值匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM