Download the PHP package worksome/foggy without Composer

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

Foggy - Database scrubbing

Foggy is a package which creates a database dump of your database, but with scrubbed data. Perfect for taking a production database and use locally.

Install

For installation via Composer `

For installation in a Laravel application

Usage

For usage with Laravel, read more in Laravel Foggy docs.

Configuration

The configuration lies in a JSON file, which has to adhere to the schema.json file. You can validate your configuration file on jsonschemavalidator.net or directly in phpstorm.

For the most basic configuration, where all tables are dumped, but no data is scrubbed, we simply do:

Here we have specified that all tables and views (*) should be dumped with data by default. A more secure default would be to set withData to false, so only schema definitions are exported, if nothing specific is specified.

Defining rules for a table

All table definitions live inside database key in the json object. Each table can have an array of rules. A rule consist of the following

In the following snippet we have added some rules for the users table. It shows a quick example of some rules and parameters.

Rules

Each table can have an array of rules. Rules are applied to a specific column and can modify the values in that column per row.

Faker

The faker rule is to replace the value with a new fake value. It uses the faker library underneath, so all formatters available in faker can be used here.

For calling a simple faker property, simply specify value as the property you want to use. In the following example we are calling the email faker.

Sometimes you might want to use faker formatters which takes arguments. Arguments can be supplied by using the params key in the json object. In the following example we specify that we only want to generate male names.

Replacer

The replacer rule replaces a column with the given value. It's a simple rule for when you just want all entries to have the same value. A great use-case is for setting all passwords to the same value, so when using the scrubbed database, you can log in on all user's with the same password. In the following example we replace all passwords with secret, but a hashed edition of it.

PHP

The PHP rule is a basic, but really powerful rule. It allows you to define a PHP string which will be applied to the column. This string has a few variables which can be accessed.

The PHP string will be evaluated, and the value returned from it will be the new value of the column. It is not needed to write return, as the statement is wrapped in a return automatically.

Conditions

Times

It is possible to limit a column to only be applied x amount of times, by supplying an argument named times. This will limit, so the rule is only applied until the times are hit.

SQL Views

All views definitions live inside database key in the json object. In opposition to tables, views do not have any particular rules applicable to them.

Only requirement is for them to be listed in the json object to be included in the import. The wildcard configuration * will include them all.


All versions of foggy with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
ext-pdo Version *
doctrine/dbal Version ^3.6
symfony/console Version ^6.4 || ^7.0
symfony/var-dumper Version ^6.4 || ^7.0
thecodingmachine/safe Version ^2.5
fakerphp/faker Version ^1.10
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 worksome/foggy contains the following files

Loading the files please wait ....