Faker

This page is not translated yet. Showing original version of page. You can sign up and help with translating.

#1. What is FakerPHP used for?

The FakerPHP library is used to generate fake data for testing and debugging purposes via its properties called formatters. The Faker plugin utilizes the library to generate fake:

  • pages.
  • comments.
  • user accounts.

#2. Installation

  1. Install FakerPHP via Composer: composer require fakerphp/faker
  2. Copy the 'faker' folder to your Cotonti plugins folder.
  3. Install it via Administration / Extensions.
  4. Configure path to FakerPHP and Locale via plugin config

#3. Use

The following options are available to generate fake pages:

  • number of pages to create,
  • page title length,
  • page description length,
  • page_text length,
  • page section.

Page date is set randomly between the first user registration date and the current date.

The following options are available to generate fake comments:

  • number of comments to create,
  • comment text length.

Comment date is set randomly between the first user registration date and the current date. Target page is selected randomly.

The following options are available to generate fake user accounts:

  • number of accounts to create,
  • user group.

#4. Credits

  • Francois Zaninotto for his Faker library
  • Twibie for the first Cotonti implementation

1. Macik  6. April 2014, 08:37

Note: requires PHP > 5.3.3

2. Slaweally  2. Mai 2014, 22:03

Thanks guy ;)

3. Sergeich  15. Dezember 2025, 12:47

О, спасибо Корт.