Skip to content

Commit

Permalink
Add prefix configuration, fixes #6 (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage committed Dec 31, 2020
1 parent 06d047e commit b6ed79d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
name: Test code style
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Dependencies
Expand All @@ -20,6 +24,10 @@ jobs:
name: Static analysis
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Dependencies
Expand All @@ -30,6 +38,10 @@ jobs:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Dependencies
Expand All @@ -40,6 +52,10 @@ jobs:
name: Report Coverage
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"require": {
"symfony/framework-bundle": "^5.0",
"rikudou/psr6-dynamo-db": "^1.3.1",
"rikudou/psr6-dynamo-db": "^1.4",
"php": "^7.2 | ^8.0",
"symfony/cache": "^5.0"
},
Expand Down
4 changes: 4 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ public function getConfigTreeBuilder()
->info('The field to be used as value')
->defaultValue('value')
->end()
->scalarNode('key_prefix')
->info('The prefix used in front of keys when storing')
->defaultNull()
->end()
->end();

return $treeBuilder;
Expand Down
1 change: 1 addition & 0 deletions src/DependencyInjection/RikudouDynamoDbCacheExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ private function createCacheClient(ContainerBuilder $container, array $configs,
$definition->addArgument($configs['primary_key_field']);
$definition->addArgument($configs['ttl_field']);
$definition->addArgument($configs['value_field']);
$definition->setArgument('$prefix', $configs['key_prefix']);
}

/**
Expand Down

0 comments on commit b6ed79d

Please sign in to comment.