elcweb / keyvaluestore-bundle
Allows you to easily access and set key-value
Installs: 1 301
Dependents: 0
Suggesters: 1
Security: 0
Stars: 2
Watchers: 2
Forks: 4
Open Issues: 4
Type:symfony-bundle
Requires
- php: >=5.6.1
- 51systems/doctrine-encrypt: ~4.0
- doctrine/dbal: <2.5
- doctrine/doctrine-bundle: ~1.4
- doctrine/orm: ~2.2,>=2.2.3,<2.5
- elcweb/common-bundle: dev-master
- elcweb/doctrine-encrypt-bundle: 0.1.*
- jms/serializer-bundle: dev-master
- stof/doctrine-extensions-bundle: dev-master
- symfony/symfony: >=2.4,<3.0-dev
Requires (Dev)
- phpunit/phpunit: 5.4.*
Suggests
README
Installation
Step 1: Download using composer
{ "require": { "elcweb/keyvaluestore-bundle": "~2.0" } }
Now tell composer to download the bundle by running the command:
$ php composer.phar update elcweb/keyvaluestore-bundle
Step 2: Enable the bundle
Enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Elcweb\KeyValueStoreBundle\ElcwebKeyValueStoreBundle(), ); }
Step 3: Doctrine Migration (optional)
If you are upgrading from version 1.x you will need to do a migration. We recommend using DoctrineMigration
An migration example exist in
DoctrineMigrations/Version20150715164320.php
Make sure that your parameter %secret% is 32 characters long.
Usage
Get a value
$ks = $this->get('elcweb.keyvaluestore'); $value = $ks->get('KeyName');
Get all values starting with a pattern
$ks = $this->get('elcweb.keyvaluestore'); $values = $ks->getAll('KeyName'); // If you have a keys called foo.bar and foo.foo this will return an array with key bar and foo
Set a value
$ks = $this->get('elcweb.keyvaluestore'); $ks->set('key', 'value', 'optional description');
License
This bundle is under the MIT license. See the complete license in the bundle:
Resources/meta/LICENSE
Reporting an issue or a feature request
Issues and feature requests are tracked in the Github issue tracker.
When reporting a bug, it may be a good idea to reproduce it in a basic project built using the Symfony Standard Edition to allow developers of the bundle to reproduce the issue by simply cloning it and following some steps.