Download the PHP package ggomez/anonymization without Composer
On this page you can find all versions of the php package ggomez/anonymization. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ggomez/anonymization
More information about ggomez/anonymization
Files in ggomez/anonymization
Informations about the package anonymization
Anonymization
Anonimization is a PHP library that helps you to anonymize your databases in a fast and dynamic way.
Note: The data is permanently modified
Installation
Module for database anonymisation
You only have to call the class in this way:
The anonymous class constructor accepts two parameters:
- Anonymization Configuration File
-
Anonymization Configuration DataBase connection
However, the constructor uses by default the files that are in the path: vendor/ggomez/anonymization/src/Config
One of the most important parts of anonymization is the configuration file. In the path above, you will find examples of the 3 allowed formats YML, JSON, PHP.
It is very important to maintain the structure, in this case we have a database that his name is "Test", then in the second part there is the sensitive word section, in this part we are going to describe all word that we want to change, the first word is that one we want to change and the seconds is that one we want to add in the database.
In the first part only the database to be anonymized is indicated, in the second part the sensitive words that could reveal someone's identity are specified and finally, in the last section the necessary settings for the anonymization of the database are inserted.
There are 3 options for data anonymisation:
- Generate data from a given format
- In this case the character "asterisk" is going to become a number, for exmple if we have a user's name in this field we are going to get a generic format with successive numbers
-
Generate new data from the RandomData table
- When executing the library, a temporary table is loaded containing random data that can be used to anonymize complete tables
- Generate new data
- If you want to generate a random data, such as an address or phone number, you can do it with the following syntax
In all cases it is recommended to use a condition, especially the following syntax is recommended in cases where you want to use the RandomData table, this to get different results in each line of the table