A default phar file is provided in the releases section of the project on GitHub.
However, it is also possible to compile the phar manually. This allows to:
- Add custom converters
- Add custom templates
- Add Faker locales
To compile the phar:
- Fork the project, then clone it.
- Do whatever you need (add custom converters, custom templates...).
- Run the following command:
php -d phar.readonly=off bin/compile
. This will create a file named "gdpr-dump.phar" in the folder "build/dist".
To add converters, there are only two requirements:
- The file must be in the directory "src/Converter" (or a subdirectory).
- The class must implement the interface
ConverterInterface
.
Templates are located in the directory "app/config/templates".
The files must use the .yaml
extension.
By default, the phar file is bundled with the en_US locale of Faker. It does not contain the other locales.
To add other locales, you must edit the following parameters in app/config/services.yaml:
faker.locale
: the locale used by defaultfaker.installed_locales
: the locales that are included in the compiled phar
For example, to replace the en_US
locale by fr_FR
:
faker.locale: 'fr_FR'
faker.installed_locales:
- 'fr_FR'
Available locales can be found in the official faker documentation.