There is no license information available for the latest version (dev-master) of this package.

A drop-in replacement for mysqldump that optionally sanitizes DB fields for better GDPR conformity.

dev-master 2019-09-24 15:57 UTC

This package is auto-updated.

Last update: 2024-03-25 03:13:54 UTC


        arguments: ["@doctrine.orm.entity_manager"]

    Arxy\GdprDumpBundle\Transformer\FakerTransformer: ~
    Arxy\GdprDumpBundle\Transformer\StaticValueTransformer: ~
    Arxy\GdprDumpBundle\Transformer\SymfonyPasswordTransformer: ~

    dsn: 'mysql://user:password@host:port/dbName'
    value_converter: 'Arxy\GdprDumpBundle\Converter\DoctrineConverter' // optional
                transformer: Arxy\GdprDumpBundle\Transformer\FakerTransformer
                    generator: firstName
                    arguments: { 'gender': 'male' }
                    locale: en_US


Converters are used to convert value from database to PHP and vice-versa. (For example - convert string '2019-08-20 23:50:50' to \DateTime(''2019-08-20 23:50:50'))

Available converters:

Arxy\GdprDumpBundle\Converter\DoctrineConverter - uses Doctrine metadata to convert values.


Transformers are used to transform value of column to GDPR-compatible.

Available transformer:

Arxy\GdprDumpBundle\Transformer\FakerTransformer used with option generator, arguments and/or locale See for all available generator/arguments values.

Arxy\GdprDumpBundle\Transformer\JsonTransformer - decorates another transformer. Simply json_encode it's value.

Arxy\GdprDumpBundle\Transformer\SerializeTransfoemr - decorates another transformer. Simply serialize it's value.

Arxy\GdprDumpBundle\Transformer\StaticValueTransformer - sets the value of option value

Arxy\GdprDumpBundle\Transformer\SymfonyPasswordTransformer used with option password and saltColumn. Encodes password as per security section of Symfony Configuration.

You can always add your own Transformer which fits your needs. Just create your own class which implements Arxy\GdprDumpBundle\Transformer or extends Arxy\GdprDumpBundle\AbstractTransformer and register it as Symfony Service with tag arxy.gdpr_mysqldump.transformer. If you are using Symfony with autowire and autoconfigure you probably won't need to do anything else except creating the class - symfony will take care of the other things. Voila!

How it works

First values are fetched from database. If ValueConverter is available - it converts the value into PHP variable. Then ValueTransformer is called. The returned value is passed to ValueConverter, if available which converts it into Database Value.


Use type-hint Ifsnop\Mysqldump\Mysqldump and see documentation of library at

Configuring and installing using pure php.

$valueTransformer = new \Arxy\GdprDumpBundle\ValueTransformer();
$valueTransformer->addTransformer(new \Arxy\GdprDumpBundle\Transformer\FakerTransformer());

$tableCustomers = new \Arxy\GdprDumpBundle\Metadata\TableMetadata("customers");
$tableCustomers->addColumn(new \Arxy\GdprDumpBundle\Metadata\ColumnMetadata("firstName", \Arxy\GdprDumpBundle\Transformer\FakerTransformer::class, [
'generator' => 'firstName']));

$mysqldump = new \Ifsnop\Mysqldump\Mysqldump($dsn, $user, $password, $dumpSettings, $pdoSettings);