Download the PHP package unclecheese/mock-dataobjects without Composer

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

Mock DataObjects for SilverStripe

This module provides intelligent content generation functionality to all DataObjects. The object introspects its fields and assigns an example value based on the field type and the name of the field. It also provides a command line utility for generating mock data programatically as well as various UI features in the CMS to support the creating and populating DataObjects.

Installation

Installation via Composer is highly recommended, as this module has external dependencies.

Example

Result:

Screenshot

Implementation

You can use the features of the MockDataObjects module in many ways, including executable code, a command-line interface, and from within the CMS.

From the CMS

Adding mock children to a parent page:

Right click on the parent page and choose "Add mock children."

Screenshot

Choose options, and create

Screenshot

Adding items to a grid

Just click on "add mock data" and set your options.

Screenshot

Populating existing records

Click on "fill with mock data"

Screenshot

In the execution pipeline

As demonstrated above, the ->fill() method populates a DataObject with mock data. There are a few options you can pass to this method.

From the command line

Create 50 new records. Use existing files for file relationships.

Populate existing records with new data.

Add new records to the has_many relation on a given page.

Localisation

Mock data values are localised to the current locale as defined by .

Field name hooks

For generic database fields, such as Varchar, the mock data generator is informed by the field name in order to create more realistic data. These hooks are defined in the language file.

A comma-separated list of possible field names are mapped to an entity, so that a field named "EmailAddress" or "Email" creates a fake email address, and "Phone" or "Telephone" creates a fake phone number.

An example language file for French might look like this:

Model-independent data generation

Sometimes it is useful to generate mock data before the model has been created, such as when frontend development is happening before backend development. For that purpose, every DataObject comes with a method to access the fake data generator.

Cleaning up

Records of all mockdata creation are stored in the table, which maps a record ID to a class name. You can clean this table using the task . To clear all mock data, leave the class name argument null.

Be very careful about converting mock data records into authentic records, as this task will clean them up without knowing that you have populated them with valid data!

Troubleshooting

Just ring Uncle Cheese.


All versions of mock-dataobjects with dependencies

PHP Build Version
Package Version
Requires silverstripe/framework Version ~3.1
silverstripe/cms Version ~3.1
fzaninotto/faker Version 1.1.*@dev
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 unclecheese/mock-dataobjects contains the following files

Loading the files please wait ....