Download the PHP package kfilin/randdata without Composer

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

RandData

Build Status

Data generator with support for complex data and dependency realization. You can check demo site of the project.

Installation

Basic usage

More examples in src/examples folder

Raw random values example

Filling string by template

Let's we have a string with a pair of variable words in it. We will fill this fields with random values:

Let's make it a little more complicated:

Generators. Creating csv

Generators. Filling database and more

First of all, you can define your data manually:

If your database is too big and you want to get it fast, you can get it from sql SHOW CREATE TABLE command:

If you want it VERY fast and you don't care much about plausibility, you can fill all database tables (if any field is NULL possible, its value will be NULL with about 50% probability):

Currenty only this data types supported (feel free to ask for extanding the list or make your own contribution to the project):

Data dependency

In real life data is dependant. Birth must be before death, sunrise time before sunset time, salary is calculating from worked hours, hourly rate, fines and so on.

This library can generate data dependant from other object attributes (for example, hired date dependant from birth date).

If you have dependencies between different objects (Authors and Books), it can be little tricky, but something about this:

Or simplier, if you test with 100 authors:

Data dependency. Nested datasets

Another way to declare dependency is nested datasets

Filling forms

See demo site

Main Objects

RandData Fabric

Creates RandDataSet objects

RandData Set

Generates one random value. Atomic piece of data, may be simple (boolean, number or char) or complex, for example PersonName Object (FirstName + MiddleName + LastName) or AviaTicket Order Object (departure information, route, passenger list, status information and so on)

Tuple

Manages list of datasets. Can add dataset from PHP object or from string. Generates array of random values

RandData Generator

Manages generation process. Produces amount of random datasets (array of arrays of random values).

RandData Formatter

Buids data stream into something useful. Now it can be csv file, sql INSERT commands or JSON array.

DataSet options

All DataSet can be created from string identificator ("boolean", "string", "integer" and so on):

There also may be an optional params:

Params seperated by semicolon and name/value pairs separated by equal sign:

Value may be an array item, its item seperated by comma:

Counter

Simple counter. Generates number sequence inside string or as number. When calling by Generator object, it is incremented automatically. When calling direct or by Tuple object, you need to set counter value manually

ID

counter, cnt

Params

Initialization string example

Boolean

ID

boolean

Params

Initialization string examples

Integer

ID

int, integer

Params

Initialization string examples

Decimal

ID

decimal

Params

Initialization string examples

String

A string of selected chars

ID

string

Params

Initialization string examples

Paragraph

A paragraph of words (random char strings) separated by spaces

ID

paragraph

Params

Initialization string examples

String List

String from the list

ID

string_list

Params

Initialization string examples

Time

ID

time

Params

Initialization string examples

Date

ID

date

Params

Initialization string examples

Datetime

ID

datetime

Params

Initialization string examples

Phone

ID

phone

Params

Initialization string examples

Domain

ID

Two level www domain

domain

Params

Initialization string examples

Email

ID

email

Params

Initialization string example

Value

Generates single value

ID

value

Params

Initialization string example

Complex

Dataset consists of other datasets

ID

complex

Params

Initialization string example

Examples

DataSet (en_GB)

Address

ID

en_address

Params

No params

City

ID

en_city

Params

Initialization string example

Person

ID

en_person

Params

Initialization string examples

Postcode

ID

en_postcode

Params

No params

Street

ID

en_street

Params

No params

DataSet (ru_RU)

Address (ru)

ID

ru_address

Params

Initialization string examples

City (ru)

ID

ru_city

Params

No params

Person (ru)

ID

ru_person

Params

Initialization string examples

Postcode (ru)

ID

ru_postcode

Params

No params

Street (ru)

ID

ru_street

Params

No params

TODO


All versions of randdata with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
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 kfilin/randdata contains the following files

Loading the files please wait ....