You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,30 @@
1
1
# Release Notes for Yii2 DynamoDB
2
2
3
+
## 2.0.0 - 2022-04-22
4
+
5
+
## Changed
6
+
7
+
- Composer packages has moved from `pixelandtonic/yii2-dynamodb` to `craftcms/dynamodb`.
8
+
- Namespaces have changed from `pixelandtonic\dynamodb\drivers\*` to `crafcms\dynamodb\*.`
9
+
- All components now share a `dynamoDb` property, which is a `craftcms\dynamodb\DynamoDbConnection` instance or configuration.
10
+
- Replaced `pixelandtonic\dynamodb\WithDynamoDbClient` with `craftcms\dynamodb\DynamoDbConnection`. Several properties have changed.
11
+
- Replaced `pixelandtonic\dynamodb\WithDynamoDbClient::keyPrefix` with `craftcms\dynamodb\DynamoDbConnection::formatKey`.
12
+
- A key prefix is no longer added by default to any components. You may add this to any using `craftcms\dynamodb\DynamoDbConnection::formatKey`.
13
+
- The default partition key is now `PK`, not `id`.
14
+
15
+
## Added
16
+
17
+
- Added `craftcms\dynamodb\DynamoDbConnection::partitionKeyAttribute` and `craftcms\dynamodb\DynamoDbConnection::sortKeyAttribute` to allow for compound keys.
- Added [TTL support](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html) via `craftcms\dynamodb\DynamoDbConnection::ttl` and `craftcms\dynamodb\DynamoDbConnection::ttlAttribute`.
21
+
- Added automatic TTL and garbage collection to the session component.
22
+
23
+
## Fixed
24
+
25
+
- Fixed an issue where an `AWS_REGION` would not automatically get used if present.
26
+
- Fixed an issue where the session component would not register itself as a session handler.
Copy file name to clipboardExpand all lines: README.md
+49-31Lines changed: 49 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# Yii2 DynamoDB Cache, Session, and Queue Driver Implementation
1
+
# DynamoDB Cache, Session, and Queue for Yii 2
2
2
3
-
[](https://packagist.org/packages/pixelandtonic/yii2-dynamodb)
[](https://packagist.org/packages/craftcms/yii2-dynamodb)
Easily use DynamoDB as a [cache](https://www.yiiframework.com/doc/guide/2.0/en/caching-overview), [session](https://www.yiiframework.com/doc/guide/2.0/en/runtime-sessions-cookies), or [queue](https://github.com/yiisoft/yii2-queue) using this library in your Yii2 or Craft CMS projects.
8
8
@@ -13,12 +13,12 @@ Easily use DynamoDB as a [cache](https://www.yiiframework.com/doc/guide/2.0/en/c
13
13
You can install the package via composer:
14
14
15
15
```bash
16
-
composer require pixelandtonic/yii2-dynamodb
16
+
composer require craftcms/yii2-dynamodb
17
17
```
18
18
19
19
## Usage
20
20
21
-
This package provides three drivers for DynamoDB; caching, sessions, and queuing.
21
+
This package provides three Yii components for DynamoDB: cache, session, and queue.
In your `app.php`, configure the `queue` component to use the driver.
123
135
124
136
```php
125
-
use \pixelandtonic\dynamodb\drivers\DynamoDbQueue;
137
+
use craftcms\dynamodb\DynamoDbQueue;
126
138
127
139
return [
128
140
'bootstrap' => [
@@ -131,13 +143,18 @@ return [
131
143
'components' => [
132
144
'queue' => [
133
145
'class' => DynamoDbQueue::class,
134
-
'table' => 'my-app-queue-table',
135
-
'tableIdAttribute' => 'id', // optional: defaults to id
136
-
'tableDataAttribute' => 'data', // optional: defaults to data
137
-
'endpoint' => 'http://localhost:8000', // optional: used for local or when using DAX
138
-
'key' => '<key>', // optional: defaults to AWS_ACCESS_KEY_ID env var
139
-
'secret' => '<secret>', // optional: defaults to AWS_SECRET_ACCESS_KEY env var
140
-
'region' => '<region>', // optional: defaults to AWS_REGION env var
146
+
'dynamoDb' => [
147
+
'table' => 'my-app-queue-table',
148
+
'partitionKeyAttribute' => 'id', // optional: defaults to 'PK'
149
+
'endpoint' => 'http://localhost:8000', // optional: used for local or when using DAX
150
+
'region' => '<region>', // optional: defaults to AWS_REGION env var
151
+
'ttl' => 60*60*24, // optional: number of seconds until items are considered expired
152
+
'ttlAttribute' => 'expires' // optional: defaults to 'TTL'
153
+
'credentials' => [
154
+
'key' => '<key>', // optional: defaults to AWS_ACCESS_KEY_ID env var
155
+
'secret' => '<secret>', // optional: defaults to AWS_SECRET_ACCESS_KEY env var
156
+
],
157
+
],
141
158
],
142
159
],
143
160
];
@@ -152,14 +169,15 @@ Tests run against local DynamoDB tables using Docker. To run tests, you must run
152
169
3. Create the DynamoDB tables for the [cache](#create-dynamodb-cache-table), [session](#create-dynamodb-session-table), and [queue](#create-dynamodb-queue-table)
153
170
4. Run the test suite with `vendor/bin/phpunit --testdox`
154
171
155
-
To make the setup and testing easier, you can run the following Composer scripts:
172
+
To make the setup and testing easier, you can run the following Composer scripts:
0 commit comments