Download the PHP package lil-pecky/random-person-generator without Composer

On this page you can find all versions of the php package lil-pecky/random-person-generator. 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 random-person-generator

Random Person Generator

This package allows you to generate people with random names, birthdays and country of birth. The country of birth can either be completely random, or based on a provided language.

This package has been developed to fit a very specific use case, but since a list of random names can be useful for many projects, I decided to publish it.

This package is heavily influenced/inspired by FakerPHP.

Getting started

Installation

This package requires PHP >= 8.1.

composer require lil-pecky/random-person-generator

Usage

There's two ways to instantiate a Generator instance;

Providing a specific locale to the factory

Randomising the locale, providing an optional language

In both cases, the provided language must be present in the

array, an exception will be thrown if an invalid language has been provided.

Generating a person, or multiple people

Available methods

As this package has mainly been written to fit a very specific use case, the amount of available methods is limited;

Some languages, like Icelandic, have gendered last names, so an optional gender can be provided to the familyName method

Source data

The names for each language/country have been generated using ChatGPT, and have been supplemented by FakerPHP names whenever possible.

Contributing

Adding names to locales

There are two ways of adding names;

  1. adding them to a specific locale's JSON file
  2. adding them to a specific locale's Name.php file

Adding names to a specific locale's JSON file

To add names to a locale's JSON file, open the locale's file in the data directory and add names to the appropriate types (male & female for given names, family, family_male & family_female for given names, middle for middle names).

Afterwards, run

to add the newly added names to the appropriate PHP files.

Adding names to a specific locale's Name.php file

To add names to a locale's Name.php file, open that file in the src/Providers/{locale} directory and add the names to the appropriate properties.

Afterwards, run

to add the newly added names to the appropriate JSON files.

Adding new locales

Adding a new locale is pretty simply. Create a new directory in the src/Providers directory in the correct format (ab_CD), and in the new directory create a Name.php file.

The new Name.php file must extend

Adding new languages

If the locale you've added a locale for which no language exists yet (for example, af_ZA for Afrikaans/South Africa), it would be appreciated if you add the new language to the

array, with the ISO 639-1 language code as key and the language name as value (for example, 'af' => 'Afrikaans').


All versions of random-person-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 lil-pecky/random-person-generator contains the following files

Loading the files please wait ....