|
Description | | Author |
This package can generate many kinds of fake data, support different languages, and automatic database seeding.
It is an extensive framework for generating fake data of several types for different purposes. Currently it can generate:
- Fake single data like for instance a name, surname, integer, text, etc..
- Fake complex data like for instance of a person: name, surname, hobby, country, etc.
- Fake data in different languages
- Fake regular expression data like for instance an url '/www.\w+.com/'
- Fake data for entering in a database table rows
- Fake Twig template string like for instance "Hello Mr {{ surname }}"
- Fake data to set to PHP object properties or using setter functions
It can output the generated fake data in JSON, array and string formats.
The configuration may be read from an array or file in the formats YAML, XML, PHP, text and INI. | |
|
Documentation
Fakerino
Fakerino is a fake data generator framework fully extensible.



Main features
-
Fake __complex data__ (e.g. person: name, surname, hobby, country, ... ).
-
Fake __single data__ (e.g. name, surname, integer, text, ...).
-
Fake data in __different languages__.
-
Fake __regular expression__ data (e.g. url => '`/www\.\w+\.com/`').
-
Fake data multiple times.
-
Fake a __database__ table row/s with one line of code.
-
Fake a __Twig__ string or file automatically (e.g. Hello Mr {{ surname }})
-
Fake a PHP __object/entity__ in one line of code (fills public properties and setters with fake data).
-
Support __JSON__, __array__ and string output.
-
Support array, __Yaml__, __XML__, __PHP__, __Txt__ and __Ini__ configurations.
-
Fake from __command line__ interface.
For more information about installation, features, support, contribution, or other,
please read the __Fakerino docs__.
Installation
Use Composer to manage the dependencies of your project.
In your project folder run:
composer require fakerino/fakerino='~0.8'
vendor/fakerino/fakerino/build/ods vendor/fakerino/fakerino/data
Like a stand-alone project run:
composer create-project fakerino/fakerino fakerino
Quick start
<?php
require ('vendor/autoload.php');
use Fakerino\Fakerino;
$fakerino = Fakerino::create();
echo $fakerino->fake('Surname')->toJson(); //["Donovan"]
echo $fakerino->fake('nameFemale'); //Alice
echo $fakerino->fake('/www\.\w+\.com/'); //www.nikdjap.com
echo $fakerino->fake('nameMale')->num(3); //Bob Jack Rick
echo $fakerino->fake(array('nameMale', 'Surname'))->num(3)->toJson(); //[["Simon","Rodgers"],["Dean","Smith"],["Anthony","Bauman"]]
With a configuration you can __combine fake data__, or declare your __customs__.
$fakerino = Fakerino::create('./conf.php');
print_r($fakerino->fake('fakeChat')->toArray());
/*
Array(
[0] => Array
(
[0] => Array
(
[0] => Fake Rino <fakerino@fake.com>
[1] => 01 Jan 2015 14:14:42
[2] => Hi gentle developer!
)
[1] => Array
(
[0] => Anonym Dev <anon@dev.com>
[1] => 01 Jan 2015 14:17:42
[2] => Hi Fakerino!
)
)
)*/
With Command line
app/fake -h
//for help
app/fake namemale surname
//Travis Baldwin
app/fake surname -j
//["Brooks"]
app/fake nameMale -n 2
//Nick Andy
app/fake country -c path/config.ini
//uses a config file
app/fake surname -l de-DE
//Schleßinger
app/fake -s 'Hello Mrs {{namefemale}} {{surname}}' -l de-DE
//Hello Mrs Seeliger Ceylin
app/fake -t tableName -c path/confix.xml -n 10
//Inserts 10 fake rows into tableName
Third parties
Fakerino
Fakerino is a fake data generator framework fully extensible.



Main features
-
Fake __complex data__ (e.g. person: name, surname, hobby, country, ... ).
-
Fake __single data__ (e.g. name, surname, integer, text, ...).
-
Fake data in __different languages__.
-
Fake __regular expression__ data (e.g. url => '`/www\.\w+\.com/`').
-
Fake data multiple times.
-
Fake a __database__ table row/s with one line of code.
-
Fake a __Twig__ string or file automatically (e.g. Hello Mr {{ surname }})
-
Fake a PHP __object/entity__ in one line of code (fills public properties and setters with fake data).
-
Support __JSON__, __array__ and string output.
-
Support array, __Yaml__, __XML__, __PHP__, __Txt__ and __Ini__ configurations.
-
Fake from __command line__ interface.
For more information about installation, features, support, contribution, or other,
please read the __Fakerino docs__.
Installation
Use Composer to manage the dependencies of your project.
In your project folder run:
composer require fakerino/fakerino='~0.8'
vendor/fakerino/fakerino/build/ods vendor/fakerino/fakerino/data
Like a stand-alone project run:
composer create-project fakerino/fakerino fakerino
Quick start
<?php
require ('vendor/autoload.php');
use Fakerino\Fakerino;
$fakerino = Fakerino::create();
echo $fakerino->fake('Surname')->toJson(); //["Donovan"]
echo $fakerino->fake('nameFemale'); //Alice
echo $fakerino->fake('/www\.\w+\.com/'); //www.nikdjap.com
echo $fakerino->fake('nameMale')->num(3); //Bob Jack Rick
echo $fakerino->fake(array('nameMale', 'Surname'))->num(3)->toJson(); //[["Simon","Rodgers"],["Dean","Smith"],["Anthony","Bauman"]]
With a configuration you can __combine fake data__, or declare your __customs__.
$fakerino = Fakerino::create('./conf.php');
print_r($fakerino->fake('fakeChat')->toArray());
/*
Array(
[0] => Array
(
[0] => Array
(
[0] => Fake Rino <fakerino@fake.com>
[1] => 01 Jan 2015 14:14:42
[2] => Hi gentle developer!
)
[1] => Array
(
[0] => Anonym Dev <anon@dev.com>
[1] => 01 Jan 2015 14:17:42
[2] => Hi Fakerino!
)
)
)*/
With Command line
app/fake -h
//for help
app/fake namemale surname
//Travis Baldwin
app/fake surname -j
//["Brooks"]
app/fake nameMale -n 2
//Nick Andy
app/fake country -c path/config.ini
//uses a config file
app/fake surname -l de-DE
//Schleßinger
app/fake -s 'Hello Mrs {{namefemale}} {{surname}}' -l de-DE
//Hello Mrs Seeliger Ceylin
app/fake -t tableName -c path/confix.xml -n 10
//Inserts 10 fake rows into tableName
Third parties