Download the PHP package nicholasjohn16/generate without Composer

On this page you can find all versions of the php package nicholasjohn16/generate. 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 generate

Generate Command

The Generate Command is used to automatically generate sample data for testing and development.

Installation

Installation is done through composer. Since this is a dev tool, requiring it as a dev tool so it's not installed in production.

Usage

The Genereate Command is integrated into Anahita's CLI. To use it, you just need to pass in the repo and entity name that you wish to generate sample data for. Optionally, you can pass in the number of entities to generate using the count argument. This is 10 by default.

For example:

The above command will generate 10 person entities.

Relationships

Relationships can be specified when generating entities. For one to many relationships, you can optionally provide an id for the relationship by seperating the relationship name and id with a colon. If no id is provided, the child for the relationship will be randomly selected.

For example if we wanted to randomly generate a note with an owner of id 2 with a random author, we'd use the below command:

Many to many relationships are not yet supported.

Attributes

Attributes are generated randomly based on their entity definition. Non-required attributes have a chance of being null. If the generated value is null and they have a default value, the default value will be used instead. Faker PHP Library is used to generate the random values. The provider used for each attribute is based on the config.json settings. Each attribute type has it's own set of defaults, followed by defaults for each entity attributes. Attributes not listed in will be skipped over and not generated.

These defaults can be overriden and extended to include attributes for your own entities. For your own projects, create a sample.json file in the main directory of your Anahita installation and add an repo and entity object like below.

Then within your entity, list any additional attributes that you'd like to be randomly generated. As well, you can optional override the provider used for the attribute type and any arguments that are passed to it. You can also override core defaults using the same method. Providers must return a string, int, boolean or DateTime object.


All versions of generate with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
anahita/anahita Version 4.3.*
fzaninotto/faker Version ^1.7
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 nicholasjohn16/generate contains the following files

Loading the files please wait ....