Download the PHP package clntdev/scrubber without Composer

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

Scrubber

Stable Build CI Status

Scrubber is a minimal PHP package with only one dependency, it allows you to define a PHP configuration file which can help update database fields with various predefined or random values.

This is perfect for when you need a copy of a production database to work on and need to erase sensitive content.

Installation

Install via composer by running: composer require clntdev/scrubber

Usage

Configuration File

The package relies on a valid PHP configuration file to function correctly, this file returns a simple array which maps out the tables, fields and their details so it knows which handler to use.

A handler is detected from the value given for a field.

Here is an example configuration used in the unit tests:

Interfaces

This package implements two interfaces which classes need to be created for, these will then be passed into and used by the main Scrubber class.

Database Class

This class should implement the ClntDev\Scrubber\Contracts\DatabaseUpdate interface which will require an update and fetch method to be defined.

Define the fetch method to return an array of values such as IDs using the given $table and $primaryKey variables to fetch them from your chosen data source.

Define the update method to update your chosen data source using the given $table,$field and $value parameters.

Logger Class

This class should implement the ClntDev\Scrubber\Contracts\Logger interface which will require a log method to be defined.

Define the log method to log any given exception message thrown during the process to your preferred logging method.

Scrubber Class

Once the configuration file has been defined and the classes above setup, all that is left to do now is initialise the Scrubber class. This will allow the database update to be run and also fields listed out depending upon the type given.

The ClntDev\Scrubber\Scrubber class can be newed up normally or a static make method has been provided to make chain calls tidier:

Pass in the absolute path to the configuration file, the created database class and the created logger class.

Methods

run() - This is the main method and will run all of the handlers from the parsed configuration file modifying the database.

getFieldList(string $type = 'pid') - This method will return an array of fields for the given type, this defaults to pid.

getFieldListAsString(string $type = 'pid') - This method will return a comma separated string of fields for the given type, this defaults to pid.

Built-in Handlers


All versions of scrubber with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
fakerphp/faker Version ^1.20
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 clntdev/scrubber contains the following files

Loading the files please wait ....