Download the PHP package orange-rt/anonymize-bundle without Composer

On this page you can find all versions of the php package orange-rt/anonymize-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package anonymize-bundle

Scrutinizer Code Quality

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

Usage

Doctrine managed entities can be anonymized by annotating the properties that you want to be anonymized. There are two annotations available, @Anonymize and @AnonymizeEntity.

Anonymizing a property

Properties can be anonymized with the @Anonymize annotation like as follows:

Upon calling php bin/console anonymize:anonymize the property username will be updated to $faker->email. The faker is generated in the driver.

Anonymizing callback

Sometimes it is required that properties need an advanced or a custom way of anonymizing said entity. If a method is annotated with the @Anonymize annotation, the method is called. If you need a faker you can typehint the parameter, like in the example below:

Upon anonymizing the person, a UniqueGenerator is created for the method and the method is invoked with the generator. The username will be the same as the email, and it will be a uniquely generated email.

Excluding entities

It is possible to either skip a property, or to skip an entire object.

Skipping objects

It is either possible to blacklist an object, or to whitelist an object. The exclusions are done with a key value pair, where the key is the name of the property, and the value is either a direct match with the value, or a regex.

The inclusions are done in the same way, if one of the inclusions is matched, the object is anonymized.

In the example below, every person will be anonymized except for the people that have a username that ends with @orangert.nl.

Changing the faker locale

The default faker locale is nl_NL. To set the locale:

Unique variables

For properties like email and usernames, unique values should be used. The Anonymize property has a unique=true flag to set use the UniqueGenerator provided by the Faker library. If a callback needs the UniqueGenerator, typehint the generator with the UniqueGenerator.

Contributing

Pull requests

There might be open issues in the Github issue tracker. I'm open to receive new pull requests and will check them as soon as I possibly can.

Issues

If you find any bugs, please report them at the issue tracker. I will look at them as soon as I possibly can.


All versions of anonymize-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/framework-bundle Version ~2.7|~3.0|~4.0
symfony/console Version ~2.7|~3.0|~4.0
symfony/dependency-injection Version ~2.7|~3.0|~4.0
nyholm/symfony-bundle-test Version ^1.2
phpunit/phpunit Version ^6.4
doctrine/annotations Version ^1.5
jms/metadata Version ^1.6
fzaninotto/faker Version ^1.7
doctrine/orm Version ^2.5
roave/security-advisories Version dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package orange-rt/anonymize-bundle contains the following files

Loading the files please wait ....