Download the PHP package brad-denver/paris-seeder without Composer

On this page you can find all versions of the php package brad-denver/paris-seeder. 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 paris-seeder

paris-seeder

A simple database seeding class using Faker data and Paris models

Example Syntax

The above example would create two roles and two users with each role.

Install and config

The easiest way to install paris-seeder and its dependencies (faker, idiorm, paris) is via Composer. This class is available through Packagist with the vendor and package identifier of brad-denver/paris-seeder.

Paris-seeder does not require any configuration itself but the following steps show how to configure Idiorm and setup Paris models for its use.

An example Idiorm config

Examples

Lets assume we are going to seed a roles table

id title
1 Boss
2 Worker

and a users table

id name role_id
1 Sally Hard 2
2 Bob Lazy 1

both with auto incrementing id fields.

Paris Models

fist we need to create classes for each table that extends the Paris Model class

The key thing here is that the models have a create_fake method that accepts an Idiorm ORM instance and Faker\Generator instance and returns the record resulting from $orm->create.

Seeder::seed

The seed method expects:

Overide faker data.

Suppling a callback.

Suppling a faker generator

Seeder::replicate

Sometimes there may be no need to use fake data for a certain table. Seeder::replicate is helper method to copy all data from one table to another (assuming they have compatible schemas).

Seeder::delete_all

as its name suggests this method simply deletes all records for given models table. It is called as the first step of Seeder::replicate and Seeder::delete_all_and_seed

Seeder::delete_all_and_seed

a helper method for the common use case of deleting and reseeding all data in a table. This method simply calls Seeder::delete_all followed by Seeder:seed for the given model. It accepts the same arguments as Seeder:seed


All versions of paris-seeder with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
fzaninotto/faker Version 1.*
j4mie/idiorm Version 1.*
j4mie/paris Version 1.*
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 brad-denver/paris-seeder contains the following files

Loading the files please wait ....