Skip to content
forked from lulco/populator

Allows populate fake data to your database

License

Notifications You must be signed in to change notification settings

tonop01/populator

 
 

Repository files navigation

Populator

Allows populate fake data to your database

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight Latest Stable Version Total Downloads PHP 7 supported

The best feature of this library is AutomaticPopulator which allows you to create fake data for one table based on its structure or column names.

Create file e.g. bin/command.php as shown below (or add PopulatorCommand to existing Symfony console application):

$application = new Symfony\Component\Console\Application();
$populator = new Populator\Command\PopulatorCommand();
$populator->addDatabase(new Populator\Database\Database('db_name', 'mysql:dbname=db_name;host=db_host', 'db_user', 'db_password'));

$table1Populator = new Populator\Populator\AutomaticPopulator('table_1', 50);
$populator->addPopulator($table1Populator);

$application->add($populator);
$application->run();

This setup will populate 50 fake rows for database table with name table_1 after executing this command:

php bin/command.php populator:populate

About

Allows populate fake data to your database

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%