mediamonks / doctrine-extensions
Doctrine2 behavioral extensions which allows to transform (encrypt, decrypt, hash) your data automatically
Installs: 11 140
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 5
Forks: 4
Open Issues: 1
Requires
- php: >=5.6
- gedmo/doctrine-extensions: ~2.4
Requires (Dev)
- codeclimate/php-test-reporter: ^0.3.0
- defuse/php-encryption: ^2.0
- doctrine/common: >=2.5.0
- doctrine/orm: >=2.5.0
- mockery/mockery: ^0.9.4
- paragonie/halite: ^3.3
- phpunit/phpunit: ^4.8
- zendframework/zend-crypt: ^2.6
Suggests
- defuse/php-encryption: to use the Defuse Crypto transformers
- doctrine/orm: to use the extensions with the ORM
- paragonie/halite: to use the Libsodium Crypto transformers
- zendframework/zend-crypt: to use the Zend Crypt transformers
This package is auto-updated.
Last update: 2020-12-29 12:00:05 UTC
README
MediaMonks Doctrine2 behavioral extensions
These extensions add more functionality to Doctrine2.
Transformable
This extension uses transform and reverseTransform methods to convert data to and from the database. This can for example be used to encrypt a field when it's sent to the database and it will be decrypted when it is retrieved from the database.
The field's value will only be transformed when the value changed which also makes it possible to implement only a transform function for one way transformations like hashing.
Currently these adapters are provided in order of recommendation:
- HaliteSymmetricTransformer - Encrypt/decrypts the value
- DefuseCryptoEncryptKeyTransformer - Encrypt/decrypts the value
- PhpHashTransformer - Hashes the value
- PhpHmacTransformer - Hashes the value with a key
- ZendCryptHashTransformer - Hashes the value
- ZendCryptHmacTransformer - Hashes the value with a key
- ZendCryptSymmetricTransformer - Encrypts/decrypts the value
You can easily create your own transformers by implementing the TransformableInterface
System Requirements
You need:
- PHP >= 5.6 or >= 7.0
To use the library.
Install
Install this package by using Composer.
$ composer require mediamonks/doctrine-extensions
Security
If you discover any security related issues, please email devmonk@mediamonks.com instead of using the issue tracker.
Documentation
Please refer to the files in the /doc folder.
Credits
This package was inspired by/uses code from gedmo/doctrine-extensions.
License
The MIT License (MIT). Please see License File for more information.