Download the PHP package owenmelbz/forget-db without Composer

On this page you can find all versions of the php package owenmelbz/forget-db. 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 forget-db

🧠 forget-db

Build Status

A simple(ish) command line tool written in PHP 7.4 using Laravel Zero and Faker to help you anonymise/pseudonymise data within your database to support protecting either sensitive information, or peoples right to be forgotten with GDPR compliance.

The tool allows you to connect to either mysql, postgres, sqlite or sqlserver and replace defined information with random data to allow you to keep statistics/relationships/audit of actions etc.

It uses a simple yaml configuration file to define the conditions for overwriting, which fields you want to overwrite, and what to overwrite them with.

Installation

I would recommend installing this globally on your system:

Alternatively you can install this with curl:

Configuration

To generate a new config just run (from anywhere) forget-db new

This will walk you through generating an example config file.

This will generate a basic config file that looks something like:

Properties

Each top level item in the config file is a database table e.g table_one

The first required property is key this is very important as it defines which column is used for the update query and most likely needs to be unique.

The second required property is columns this is simply an array of column names, with their values set to Faker methods, you can get a full list of generators Faker Generators here - most are easy to remember such as name, email, company etc. You can also use parametrized formatters like regexify.

The first optional property is conditions this should be an array of sql clauses if you need to restrict usage, e.g if you only need user_id 1 to be forgotten, then you can add where user_id = 1. You should be able to have multiple conditions, these get passed into Laravels' whereRaw method, so check out those documents if you need more advance queries.

The second optional property is joins this can be a string or array of joins which will be used to accompany the conditions, it takes a simple join query in the following format joined_table on joined_table.column = other_table.column, you can use the modifier system to prefix a table with a join type, e.g left:tablename on... this gets passed to Laravel's leftJoin(), rightJoin() and join() functions.

Modifiers

Recently we introduced the ability to add modifiers to your column definitions, currently there is only one. To use a modifier just prefix the faker method with modifier: to create something like modifier:email_address

Name Description
unique: Will utilise Fakers unique() method to generate unique data for a column
left/right: Allows you to define the type of join to execute

Usage

Once you have your config complete you can run forget-db forget ./path/to/config.yml. The wizard will ask for your connection details, and then will start the cleanse. If you specify database connection parameters in file named .env placed in the working directory, those values are automatically used by the code. See .env.example to learn more about the settings that can be configured this way. Note that in interactive mode, the environment being used at runtime (as specified using the --env switch) affects the defaults. In non-interactive mode, all yes/no questions default to yes, regardless of the environment setting. To run in non-interactive mode, use the -n switch (useful for scripted runs).

After the command is completed you'll get some output about the success of the operation (with a detailed error message as appropriate). The code returns 0 exit code on success and 1 on failure.

Dry-run

We do not have a full dry-run system, however you can preview the query that selects your data set, and a table of the data that it has found, simply specify the --dry arg after your command e.g forget-db forget ./config --dry. This will only run "selects" on your database and will not write any changes! You will see something similar to:

Limitations for dry-runs:

Warning - When doing a dry run, remember that it will output to your terminal, so if you are exposing sensitive data make sure you're taking the correct precautions!

Warnings / Notes


All versions of forget-db with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
fzaninotto/faker Version ^1.7
illuminate/database Version ^6.0
josegonzalez/dotenv Version ^3.2
knplabs/github-api Version ^2.8
laravel/helpers Version ^1.1
php-http/guzzle6-adapter Version ^1.1
symfony/yaml Version ^4.0
ext-pdo Version *
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 owenmelbz/forget-db contains the following files

Loading the files please wait ....